[swell-foop/arnaudb/wip/gtk4: 38/55] Adapt to EventController API.



commit 8cc9b8c78c57452d28adf31c1483ac83900d3e0a
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Tue May 12 21:34:35 2020 +0200

    Adapt to EventController API.

 src/window.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 2776b5c..1740156 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -330,8 +330,9 @@ private class SwellFoopWindow : ApplicationWindow
 
     private inline void init_keyboard ()
     {
-        key_controller = new EventControllerKey (this);
+        key_controller = new EventControllerKey ();
         key_controller.key_pressed.connect (on_key_pressed);
+        ((Widget) this).add_controller (key_controller);
     }
 
     private inline bool on_key_pressed (EventControllerKey _key_controller, uint keyval, uint keycode, 
Gdk.ModifierType state)
@@ -505,8 +506,9 @@ private class SwellFoopWindow : ApplicationWindow
 
     private inline void init_motion ()
     {
-        motion_controller = new EventControllerMotion (view);
+        motion_controller = new EventControllerMotion ();
         motion_controller.set_propagation_phase (PropagationPhase.CAPTURE);
         motion_controller.leave.connect (view.board_left_cb);
+        view.add_controller (motion_controller);
     }
 }


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