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.
This commit is contained in:
Emmanuele Bassi 2020-06-01 10:49:33 +01:00
parent ed02bea20d
commit 79105962a7
2 changed files with 3 additions and 27 deletions

View File

@ -2130,7 +2130,7 @@ gdk_focus_event_new (GdkSurface *surface,
/** /**
* gdk_focus_event_get_in: * 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 * Extracts whether this event is about focus entering or
* leaving the surface. * leaving the surface.
@ -2152,15 +2152,6 @@ gdk_focus_event_get_in (GdkEvent *event)
/* {{{ GdkScrollEvent */ /* {{{ GdkScrollEvent */
static void
gdk_scroll_event_init (GdkEvent *event)
{
GdkScrollEvent *self = (GdkScrollEvent *) event;
self->x = NAN;
self->y = NAN;
}
static void static void
gdk_scroll_event_finalize (GdkEvent *event) gdk_scroll_event_finalize (GdkEvent *event)
{ {
@ -2179,19 +2170,6 @@ gdk_scroll_event_get_state (GdkEvent *event)
return self->state; 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 * static GdkDeviceTool *
gdk_scroll_event_get_tool (GdkEvent *event) 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 = { static const GdkEventTypeInfo gdk_scroll_event_info = {
sizeof (GdkScrollEvent), sizeof (GdkScrollEvent),
gdk_scroll_event_init, NULL,
gdk_scroll_event_finalize, gdk_scroll_event_finalize,
gdk_scroll_event_get_state, gdk_scroll_event_get_state,
gdk_scroll_event_get_position, NULL,
NULL, NULL,
gdk_scroll_event_get_tool, gdk_scroll_event_get_tool,
NULL, NULL,

View File

@ -225,8 +225,6 @@ struct _GdkScrollEvent
{ {
GdkEvent parent_instance; GdkEvent parent_instance;
double x;
double y;
GdkModifierType state; GdkModifierType state;
GdkScrollDirection direction; GdkScrollDirection direction;
double delta_x; double delta_x;