[gnome-shell/wip/carlosg/grab-helper-captured-events: 3/4] modalDialog: Ensure to let focus manager handle key events




commit ca234e99a41bb728fd9c3986c1c9fab525829e07
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Feb 1 14:31:37 2022 +0100

    modalDialog: Ensure to let focus manager handle key events
    
    Since the grab no longer lets events bubble up to the stage unstopped,
    we should be forwarding the key events that bubbled up to the dialog
    to maybe cycle focus.
    
    Fixes focus cycling on keyboard navigation inside dialogs.

 js/ui/modalDialog.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index 259a9c6bbc..607000b357 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -101,6 +101,13 @@ var ModalDialog = GObject.registerClass({
         this.notify('state');
     }
 
+    vfunc_key_press_event() {
+        if (global.focus_manager.navigate_from_event(Clutter.get_current_event()))
+            return Clutter.EVENT_STOP;
+
+        return Clutter.EVENT_PROPAGATE;
+    }
+
     clearButtons() {
         this.dialogLayout.clearButtons();
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]