[iagno/gnome-3-36] Fix mouse buttons.



commit e49a400e0e3253f4bbd763ada4f92e66a3386f8f
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Apr 16 19:08:00 2020 +0200

    Fix mouse buttons.

 src/reversi-view.vala | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/reversi-view.vala b/src/reversi-view.vala
index dae1875..a14f8bb 100644
--- a/src/reversi-view.vala
+++ b/src/reversi-view.vala
@@ -1076,6 +1076,7 @@ private class ReversiView : Gtk.DrawingArea
 //        motion_controller.leave.connect (on_mouse_out);   // FIXME should work                             
   //  2/10
 
         click_controller = new Gtk.GestureMultiPress (this);
+        click_controller.set_button (/* all buttons */ 0);
         click_controller.pressed.connect (on_click);
     }
 
@@ -1220,6 +1221,10 @@ private class ReversiView : Gtk.DrawingArea
         if (!game_is_set)
             return;
 
+        uint button = _click_controller.get_current_button ();
+        if (button != Gdk.BUTTON_PRIMARY && button != Gdk.BUTTON_SECONDARY)
+            return;
+
         uint8 x;
         uint8 y;
         if (pointer_is_in_board (event_x, event_y, out x, out y))


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