[vlc-commits] [Git][videolan/vlc][master] qt: fix unreliable Ctrl+A shortcut handling

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Wed Mar 25 12:15:03 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
d35ee6f0 by Atul Singh at 2026-03-25T12:38:19+01:00
qt: fix unreliable Ctrl+A shortcut handling

Handle SelectAll (Ctrl+A) on key press in ListViewExt and ExpandGridView so quick key sequences are not missed.

Keep activation keys (OK/Enter/Space) on key release to preserve existing behavior and avoid double-trigger scenarios.

As requested in review, simplify deferred OK handling by keeping event.accepted assignment in the shared KeyHelper.matchOk() check.

Refs: vlc#29579

- - - - -


2 changed files:

- modules/gui/qt/widgets/qml/ExpandGridView.qml
- modules/gui/qt/widgets/qml/ListViewExt.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -250,12 +250,14 @@ FocusScope {
             }
         } else if (KeyHelper.matchPageUp(event)) {
             newIndex = Math.max(0, currentIndex - nbItemPerRow * 5)
-        } else if (KeyHelper.matchOk(event) || event.matches(StandardKey.SelectAll) ) {
-            //these events are matched on release
+        } else if (event.matches(StandardKey.SelectAll)) {
             event.accepted = true
+            selectionModel.selectAll()
         }
 
-        if (event.matches(StandardKey.SelectAll) || KeyHelper.matchOk(event)) {
+        if (KeyHelper.matchOk(event)) {
+            // Keep activation handling on release to avoid double interpretation.
+            event.accepted = true
             _releaseActionButtonPressed = true
         } else {
             _releaseActionButtonPressed = false
@@ -284,10 +286,7 @@ FocusScope {
         if (!_releaseActionButtonPressed)
             return
 
-        if (event.matches(StandardKey.SelectAll)) {
-            event.accepted = true
-            selectionModel.selectAll()
-        } else if ( KeyHelper.matchOk(event) ) {
+        if ( KeyHelper.matchOk(event) ) {
             event.accepted = true
             actionAtIndex(currentIndex)
         }


=====================================
modules/gui/qt/widgets/qml/ListViewExt.qml
=====================================
@@ -532,10 +532,13 @@ ListView {
             }
         }
 
-        // these events are matched on release
-        if (event.matches(StandardKey.SelectAll) || KeyHelper.matchOk(event)) {
+        if (event.matches(StandardKey.SelectAll)) {
+            event.accepted = true
+            if (selectionModel)
+                selectionModel.selectAll()
+        } else if (KeyHelper.matchOk(event)) {
+            // Keep activation handling on release to avoid double interpretation.
             event.accepted = true
-
             _keyPressed = true
         }
 
@@ -584,11 +587,7 @@ ListView {
 
         _keyPressed = false
 
-        if (event.matches(StandardKey.SelectAll)) {
-            event.accepted = true
-            if (selectionModel)
-                selectionModel.selectAll()
-        } else if (KeyHelper.matchOk(event)) { //enter/return/space
+        if (KeyHelper.matchOk(event)) { //enter/return/space
             event.accepted = true
             actionAtIndex(currentIndex)
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d35ee6f0b8d7a443f80510ba6fbba7debe16613b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d35ee6f0b8d7a443f80510ba6fbba7debe16613b
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list