[vlc-commits] qml: handle cancel action using NavigableFocusScope callback in player

Pierre Lamot git at videolan.org
Fri Feb 14 12:00:04 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Feb 10 11:34:19 2020 +0100| [79090a4aaee0c2a80fdcee28921b77e64babf35d] | committer: Jean-Baptiste Kempf

qml: handle cancel action using NavigableFocusScope callback in player

  this avoids double handling of the key

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=79090a4aaee0c2a80fdcee28921b77e64babf35d
---

 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



More information about the vlc-commits mailing list