[gnome-games/wip/exalm/gtk4: 14/37] 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: 14/37] fullscreen-box: Stop using 'motion-notify-event' signal
- Date: Fri, 17 May 2019 15:56:32 +0000 (UTC)
commit 459fd80c9d53020524639e0453c5eda19059c773
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 65008abe..dd0414b1 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]