[gnome-chess/arnaudb/wip/gtk4: 35/54] Use GestureClick.




commit 69d498a3d260de3ea6a02e0f51a876b0053ed90f
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Tue Apr 7 09:54:38 2020 +0200

    Use GestureClick.

 src/chess-view.vala | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/chess-view.vala b/src/chess-view.vala
index d722890..0731a04 100644
--- a/src/chess-view.vala
+++ b/src/chess-view.vala
@@ -19,7 +19,7 @@ public class ChessView : Gtk.DrawingArea
     private Cairo.Surface? selected_model_surface;
     private string loaded_theme_name = "";
 
-    private Gtk.GestureMultiPress click_controller; // for keeping in memory
+    private Gtk.GestureClick click_controller;          // for keeping in memory
 
     private ChessScene _scene;
     public ChessScene scene
@@ -278,11 +278,12 @@ public class ChessView : Gtk.DrawingArea
 
     private inline void init_mouse ()
     {
-        click_controller = new Gtk.GestureMultiPress (this);    // only reacts to Gdk.BUTTON_PRIMARY
+        click_controller = new Gtk.GestureClick ();     // only reacts to Gdk.BUTTON_PRIMARY
         click_controller.pressed.connect (on_click);
+        add_controller (click_controller);
     }
 
-    private inline void on_click (Gtk.GestureMultiPress _click_controller, int n_press, double event_x, 
double event_y)
+    private inline void on_click (Gtk.GestureClick _click_controller, int n_press, double event_x, double 
event_y)
     {
         if (scene.game == null || scene.game.should_show_paused_overlay)
             return;


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