[gnome-games/wip/exalm/gtk4: 43/62] fullscreen-box: Stop using 'motion-notify-event' signal



commit 2153ac0e57591822d56da915aa66f5e7aaf158d3
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Jul 29 00:17:31 2018 +0500

    fullscreen-box: Stop using 'motion-notify-event' signal
    
    Use Gtk.EventControllerMotion instead.

 data/ui/fullscreen-box.ui  | 12 ++++++++++--
 src/ui/fullscreen-box.vala |  4 +---
 2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/data/ui/fullscreen-box.ui b/data/ui/fullscreen-box.ui
index 27b453da..8d8612c3 100644
--- a/data/ui/fullscreen-box.ui
+++ b/data/ui/fullscreen-box.ui
@@ -5,7 +5,11 @@
     <property name="visible">True</property>
     <property name="events">GDK_POINTER_MOTION_MASK</property>
     <signal name="notify::is-fullscreen" handler="on_fullscreen_changed"/>
-    <signal name="motion-notify-event" handler="on_motion_event"/>
+    <child>
+      <object class="GtkEventControllerMotion">
+        <signal name="motion" handler="on_motion_event"/>
+      </object>
+    </child>
     <child>
       <object class="GtkOverlay" id="overlay">
         <property name="visible">True</property>
@@ -17,7 +21,11 @@
             <property name="transition-type">slide-down</property>
             <property name="events">GDK_POINTER_MOTION_MASK</property>
             <signal name="notify::is-fullscreen" handler="on_fullscreen_changed"/>
-            <signal name="motion-notify-event" handler="on_motion_event"/>
+            <child>
+              <object class="GtkEventControllerMotion">
+                <signal name="motion" handler="on_motion_event"/>
+              </object>
+            </child>
           </object>
         </child>
       </object>
diff --git a/src/ui/fullscreen-box.vala b/src/ui/fullscreen-box.vala
index 35226c9a..e31776b2 100644
--- a/src/ui/fullscreen-box.vala
+++ b/src/ui/fullscreen-box.vala
@@ -69,10 +69,8 @@ private class Games.FullscreenBox : Gtk.EventBox, Gtk.Buildable {
        }
 
        [GtkCallback]
-       private bool on_motion_event (Gdk.EventMotion event) {
+       private void on_motion_event (Gtk.EventControllerMotion controller, double x, double y) {
                on_activity ();
-
-               return false;
        }
 
        private void on_activity () {


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