[swell-foop] Only bind the keypress callback when it is time to use it.



commit d4f15b26d2b34e2d372a328d5ee4da7ae2b7c870
Author: Robert Mibus <mibus google com>
Date:   Mon May 15 22:18:53 2017 +1000

    Only bind the keypress callback when it is time to use it.
    
    Otherwise, it ends up swallowing keypresses to the first-run screen, preventing keyboard-based dismissal 
of the first-run screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769921

 src/swell-foop.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/swell-foop.vala b/src/swell-foop.vala
index 9dd8397..110971e 100644
--- a/src/swell-foop.vala
+++ b/src/swell-foop.vala
@@ -96,6 +96,7 @@ public class SwellFoop : Gtk.Application
              * stack.set_transition_duration (500);
              */
             stack.set_visible_child_name ("game");
+            window.key_press_event.connect (key_press_event_cb);
             settings.set_boolean ("first-run", false);
         });
         first_vbox.pack_start (play_button, false);
@@ -175,6 +176,7 @@ public class SwellFoop : Gtk.Application
         else
         {
             vbox.pack_start (clutter_embed, true, true);
+            window.key_press_event.connect (key_press_event_cb);
         }
 
         stage = (Clutter.Stage) clutter_embed.get_stage ();
@@ -209,8 +211,6 @@ public class SwellFoop : Gtk.Application
 
         history = new History (Path.build_filename (Environment.get_user_data_dir (), "swell-foop", 
"history"));
         history.load ();
-
-        window.key_press_event.connect (key_press_event_cb);
     }
 
     private bool key_press_event_cb (Gtk.Widget widget, Gdk.EventKey event)


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