diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-03-06 14:56:46 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-03-16 23:03:41 -0400 |
commit | 15407972374592bcc3e658f9e9c3b657d5a29e5f (patch) | |
tree | 146995c85aa2bb1890279d7f186b9c5e501272d8 | |
parent | 898728fb2df157242fc63cce9b11278184d21d05 (diff) | |
download | gtk+-15407972374592bcc3e658f9e9c3b657d5a29e5f.tar.gz |
motion controller: add details to signals
The ::enter and ::leave signals get emitted up and down the
connecting path between the old an the new pointer location.
The signals are less useful if you can't find out where along
the path you are. That is what crossing mode and detail are
about, so add those to the signals.
-rw-r--r-- | gtk/gtkeventcontrollermotion.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/gtk/gtkeventcontrollermotion.c b/gtk/gtkeventcontrollermotion.c index f1d0d33a77..5f40e94ade 100644 --- a/gtk/gtkeventcontrollermotion.c +++ b/gtk/gtkeventcontrollermotion.c @@ -67,16 +67,27 @@ gtk_event_controller_motion_handle_event (GtkEventController *controller, if (type == GDK_ENTER_NOTIFY) { double x, y; + GdkCrossingMode mode; + GdkNotifyType detail; + gdk_event_get_coords (event, &x, &y); - g_signal_emit (controller, signals[ENTER], 0, x, y); + gdk_event_get_crossing_mode (event, &mode); + gdk_event_get_crossing_detail (event, &detail); + g_signal_emit (controller, signals[ENTER], 0, x, y, mode, detail); } else if (type == GDK_LEAVE_NOTIFY) { - g_signal_emit (controller, signals[LEAVE], 0); + GdkCrossingMode mode; + GdkNotifyType detail; + + gdk_event_get_crossing_mode (event, &mode); + gdk_event_get_crossing_detail (event, &detail); + g_signal_emit (controller, signals[LEAVE], 0, mode, detail); } else if (type == GDK_MOTION_NOTIFY) { double x, y; + gdk_event_get_coords (event, &x, &y); g_signal_emit (controller, signals[MOTION], 0, x, y); } @@ -107,7 +118,12 @@ gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass) G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, - G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE); + G_TYPE_NONE, + 4, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + GDK_TYPE_CROSSING_MODE, + GDK_TYPE_NOTIFY_TYPE); /** * GtkEventControllerMotion::leave: @@ -121,7 +137,10 @@ gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass) G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, - G_TYPE_NONE, 0); + G_TYPE_NONE, + 2, + GDK_TYPE_CROSSING_MODE, + GDK_TYPE_NOTIFY_TYPE); /** * GtkEventControllerMotion::motion: |