[gnome-2048/app-menu] Make game not react if hamburger menu is visible.



commit a3508b56064909434b016da98e28f408eef3c94b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Tue Jan 8 16:15:06 2019 +0100

    Make game not react if hamburger menu is visible.
    
    Without that, hitting Up or Down for changing hamburger menu
    entry makes at the same time the game react to the key press
    as a move. Short fix, testing the key pressed in the window.

 src/application.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/application.vala b/src/application.vala
index ba786cf..9655433 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -414,6 +414,9 @@ public class Application : Gtk.Application
     {
         _game_restored = false;
 
+        if (_hamburger_button.active && (event.keyval == Gdk.Key.Down || event.keyval == Gdk.Key.Up))
+            return false;
+
         return _game.key_pressed (event);
     }
 


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