[gnome-tetravex] Fix mouse buttons.



commit 5c311c51675eddd448cea8a5d5f0292850a8fb1c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Apr 16 17:31:17 2020 +0200

    Fix mouse buttons.

 src/gnome-tetravex.vala | 1 +
 src/puzzle-view.vala    | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index 70ec421..5ed180a 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -382,6 +382,7 @@ private class Tetravex : Gtk.Application
         view.can_focus = true;
         view.show ();
         view_click_controller = new GestureMultiPress (view);
+        view_click_controller.set_button (/* all buttons */ 0);
         view_click_controller.released.connect (on_release_on_view);
         settings.bind ("theme", view, "theme-id", SettingsBindFlags.GET | SettingsBindFlags.NO_SENSITIVITY);
 
diff --git a/src/puzzle-view.vala b/src/puzzle-view.vala
index bb4a2f7..6903bb8 100644
--- a/src/puzzle-view.vala
+++ b/src/puzzle-view.vala
@@ -687,6 +687,7 @@ private class PuzzleView : Gtk.DrawingArea
 //        motion_controller.leave.connect (on_mouse_out);                       // FIXME should work, 2/8
 
         click_controller = new Gtk.GestureMultiPress (this);
+        click_controller.set_button (/* all buttons */ 0);
         click_controller.pressed.connect (on_click);
         click_controller.released.connect (on_release);
     }
@@ -701,7 +702,7 @@ private class PuzzleView : Gtk.DrawingArea
             return;
         clear_keyboard_highlight (/* only selection */ false);
 
-        uint button = _click_controller.get_button ();
+        uint button = _click_controller.get_current_button ();
         if (button == Gdk.BUTTON_PRIMARY || button == Gdk.BUTTON_SECONDARY)
         {
             main_button_pressed (n_press, event_x, event_y);


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