[gnome-taquin] Fix mouse buttons.



commit ec6976368d9c6fc9cee608778a9aea87166c5e3c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Apr 16 19:04:15 2020 +0200

    Fix mouse buttons.

 src/taquin-view.vala | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/taquin-view.vala b/src/taquin-view.vala
index a20d6dd..ebcda62 100644
--- a/src/taquin-view.vala
+++ b/src/taquin-view.vala
@@ -480,6 +480,7 @@ private class TaquinView : Gtk.DrawingArea
     private void init_mouse ()  // called on construct
     {
         click_controller = new Gtk.GestureMultiPress (this);
+        click_controller.set_button (/* all buttons */ 0);
         click_controller.pressed.connect (on_click);
     }
 
@@ -488,6 +489,10 @@ private class TaquinView : Gtk.DrawingArea
         if (finished || animate || animate_end)
             return;
 
+        uint button = _click_controller.get_current_button ();
+        if (button != Gdk.BUTTON_PRIMARY && button != Gdk.BUTTON_SECONDARY)
+            return;
+
         draw_lights = false;
         game.request_move ((int8) ((int) (event_x - x_offset - grid_border_main + tile_size) / tile_size - 
1),
                            (int8) ((int) (event_y - y_offset - grid_border_main + tile_size) / tile_size - 
1),


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