[vlc-devel] [PATCH 15/22] qml: handle cancel action using NavigableFocusScope callback in player

Pierre Lamot pierre at videolabs.io
Fri Feb 14 11:23:50 CET 2020


  this avoids double handling of the key
---
 modules/gui/qt/player/qml/Player.qml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index 1cc8adb969..e0485f7f26 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -51,12 +51,6 @@ Widgets.NavigableFocusScope {
             return
         if (event.key === Qt.Key_Menu) {
             toolbarAutoHide.toggleForceVisible()
-        } else if (KeyHelper.matchCancel(event)) {
-
-            if (player.hasVideoOutput) {
-               mainPlaylistController.stop()
-            }
-            history.previous(History.Go)
         } else {
             defaultKeyReleaseAction(event, 0)
         }
@@ -66,6 +60,13 @@ Widgets.NavigableFocusScope {
             rootWindow.sendHotkey(event.key, event.modifiers);
     }
 
+    navigationCancel: function() {
+        if (player.hasVideoOutput) {
+           mainPlaylistController.stop()
+        }
+        history.previous()
+    }
+
     //center image
     Rectangle {
         visible: !rootWindow.hasEmbededVideo
-- 
2.17.1



More information about the vlc-devel mailing list