[five-or-more/arnaudb/wip/gtk4: 10/29] Update to GestureClick.



commit 91bc2e96e38aebbf38c66fc1eff0ad075a2f7624
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Mar 12 21:27:01 2020 +0100

    Update to GestureClick.
    
    And other EventController things.

 src/view.vala | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/view.vala b/src/view.vala
index 17b2694..74dd336 100644
--- a/src/view.vala
+++ b/src/view.vala
@@ -52,7 +52,7 @@ private class View : DrawingArea
     private uint animation_id;
 
     private EventControllerKey key_controller;          // for keeping in memory
-    private GestureMultiPress click_controller;         // for keeping in memory
+    private GestureClick click_controller;              // for keeping in memory
 
     internal View (GLib.Settings settings, Game game, ThemeRenderer theme)
     {
@@ -165,8 +165,9 @@ private class View : DrawingArea
 
     private void init_keyboard ()
     {
-        key_controller = new Gtk.EventControllerKey (this);
+        key_controller = new Gtk.EventControllerKey ();
         key_controller.key_pressed.connect (on_key_pressed);
+        add_controller (key_controller);
     }
 
     private inline bool on_key_pressed (Gtk.EventControllerKey _key_controller, uint keyval, uint keycode, 
Gdk.ModifierType state)
@@ -290,11 +291,12 @@ private class View : DrawingArea
 
     private void init_mouse ()
     {
-        click_controller = new GestureMultiPress (this);
+        click_controller = new GestureClick ();
         click_controller.pressed.connect (on_click);
+        add_controller (click_controller);
     }
 
-    private inline void on_click (GestureMultiPress _click_controller, int n_press, double event_x, double 
event_y)
+    private inline void on_click (GestureClick _click_controller, int n_press, double event_x, double 
event_y)
     {
         if (game == null || game.animating)
             return;


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