[gnome-games/wip/exalm/gtk4: 23/44] fullscreen-box: Stop using 'motion-notify-event' signal
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/gtk4: 23/44] fullscreen-box: Stop using 'motion-notify-event' signal
- Date: Mon, 25 Feb 2019 11:39:22 +0000 (UTC)
commit cde38df06c0487ab9334c2100af59f1406d31fc0
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]