[gtk/matthiasc/for-master] gtk-demo: Fix keynav in the puzzle



commit 382153e82d1066fdf232ddbe1562b9432b724f0c
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 1 00:09:52 2020 -0400

    gtk-demo: Fix keynav in the puzzle
    
    We need to make shortcut controller have global
    scope, otherwise the shortcuts lose against the
    window keybindings.

 demos/gtk-demo/sliding_puzzle.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/demos/gtk-demo/sliding_puzzle.c b/demos/gtk-demo/sliding_puzzle.c
index 3f1a7c3092..925d981764 100644
--- a/demos/gtk-demo/sliding_puzzle.c
+++ b/demos/gtk-demo/sliding_puzzle.c
@@ -293,6 +293,8 @@ start_puzzle (GdkPaintable *paintable)
   /* Add shortcuts so people can use the arrow
    * keys to move the puzzle */
   controller = gtk_shortcut_controller_new ();
+  gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER (controller),
+                                     GTK_SHORTCUT_SCOPE_GLOBAL);
   add_move_binding (GTK_SHORTCUT_CONTROLLER (controller),
                     GDK_KEY_Left, GDK_KEY_KP_Left,
                     -1, 0);


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