From 79105962a7e61c2338951cd2efb64f2d532d8e9b Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 1 Jun 2020 10:49:33 +0100 Subject: [PATCH] Remove position from GdkScrollEvent Scroll events do not have a position, so they shouldn't implement the GdkEventClass.get_position() virtual function; nor they should have an x and y fields that never get updated. --- gdk/gdkevents.c | 28 +++------------------------- gdk/gdkeventsprivate.h | 2 -- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 5d1d055028..e1a58006cb 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -2130,7 +2130,7 @@ gdk_focus_event_new (GdkSurface *surface, /** * gdk_focus_event_get_in: - * @event: (type GdkScrollEvent): a focus change event + * @event: (type GdkFocusEvent): a focus change event * * Extracts whether this event is about focus entering or * leaving the surface. @@ -2152,15 +2152,6 @@ gdk_focus_event_get_in (GdkEvent *event) /* {{{ GdkScrollEvent */ -static void -gdk_scroll_event_init (GdkEvent *event) -{ - GdkScrollEvent *self = (GdkScrollEvent *) event; - - self->x = NAN; - self->y = NAN; -} - static void gdk_scroll_event_finalize (GdkEvent *event) { @@ -2179,19 +2170,6 @@ gdk_scroll_event_get_state (GdkEvent *event) return self->state; } -static gboolean -gdk_scroll_event_get_position (GdkEvent *event, - double *x, - double *y) -{ - GdkScrollEvent *self = (GdkScrollEvent *) event; - - *x = self->x; - *y = self->y; - - return TRUE; -} - static GdkDeviceTool * gdk_scroll_event_get_tool (GdkEvent *event) { @@ -2202,10 +2180,10 @@ gdk_scroll_event_get_tool (GdkEvent *event) static const GdkEventTypeInfo gdk_scroll_event_info = { sizeof (GdkScrollEvent), - gdk_scroll_event_init, + NULL, gdk_scroll_event_finalize, gdk_scroll_event_get_state, - gdk_scroll_event_get_position, + NULL, NULL, gdk_scroll_event_get_tool, NULL, diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h index eca81486d2..0fd0b3e908 100644 --- a/gdk/gdkeventsprivate.h +++ b/gdk/gdkeventsprivate.h @@ -225,8 +225,6 @@ struct _GdkScrollEvent { GdkEvent parent_instance; - double x; - double y; GdkModifierType state; GdkScrollDirection direction; double delta_x;