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



commit 04dbbca28e8e9b7052bc0ecfe5fc4f26d07d52ab
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 52d68afd..edf9d0ed 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">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">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 73e83f38..05a1ce0c 100644
--- a/src/ui/fullscreen-box.vala
+++ b/src/ui/fullscreen-box.vala
@@ -67,10 +67,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]