events: Make proximity and scroll events have tools

The Wayland backend tries to set device tools on these
events, and it was just an oversight that they don't
carry them.
This commit is contained in:
Matthias Clasen 2020-02-14 16:46:43 -05:00
parent 5f7054862b
commit e5d83eea30
2 changed files with 21 additions and 0 deletions

View File

@ -707,6 +707,15 @@ gdk_event_finalize (GObject *object)
g_list_free_full (event->motion.history, g_free);
break;
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
g_clear_object (&event->proximity.tool);
break;
case GDK_SCROLL:
g_clear_object (&event->scroll.tool);
break;
default:
break;
}
@ -1834,6 +1843,11 @@ gdk_event_get_device_tool (const GdkEvent *event)
return event->button.tool;
else if (event->any.type == GDK_MOTION_NOTIFY)
return event->motion.tool;
else if (event->any.type == GDK_PROXIMITY_IN ||
event->any.type == GDK_PROXIMITY_OUT)
return event->proximity.tool;
else if (event->any.type == GDK_SCROLL)
return event->scroll.tool;
return NULL;
}
@ -1854,6 +1868,11 @@ gdk_event_set_device_tool (GdkEvent *event,
g_set_object (&event->button.tool, tool);
else if (event->any.type == GDK_MOTION_NOTIFY)
g_set_object (&event->motion.tool, tool);
else if (event->any.type == GDK_PROXIMITY_IN ||
event->any.type == GDK_PROXIMITY_OUT)
g_set_object (&event->proximity.tool, tool);
else if (event->any.type == GDK_SCROLL)
g_set_object (&event->scroll.tool, tool);
}
void

View File

@ -231,6 +231,7 @@ struct _GdkEventScroll
gdouble delta_x;
gdouble delta_y;
guint is_stop : 1;
GdkDeviceTool *tool;
};
/*
@ -370,6 +371,7 @@ struct _GdkEventProximity
{
GdkEventAny any;
guint32 time;
GdkDeviceTool *tool;
};
/*