mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
gdk: Ensure that GdkPointerWindowInfo is only generated for pointers
This commit is contained in:
parent
18e4a3a4a1
commit
c15d23ab5b
@ -1120,6 +1120,9 @@ _gdk_display_get_pointer_info (GdkDisplay *display,
|
||||
{
|
||||
GdkPointerWindowInfo *info;
|
||||
|
||||
if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
|
||||
device = gdk_device_get_associated_device (device);
|
||||
|
||||
if (G_UNLIKELY (!device))
|
||||
return NULL;
|
||||
|
||||
|
@ -9571,10 +9571,10 @@ _gdk_windowing_got_event (GdkDisplay *display,
|
||||
{
|
||||
GdkInputMode mode;
|
||||
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
pointer_info = _gdk_display_get_pointer_info (display, device);
|
||||
|
||||
if (pointer_info)
|
||||
{
|
||||
if (source_device != pointer_info->last_slave &&
|
||||
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
|
||||
pointer_info->last_slave = source_device;
|
||||
@ -9684,6 +9684,8 @@ _gdk_windowing_got_event (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
if (pointer_info)
|
||||
{
|
||||
/* Store last pointer window and position/state */
|
||||
old_state = pointer_info->state;
|
||||
old_button = pointer_info->button;
|
||||
@ -9693,6 +9695,8 @@ _gdk_windowing_got_event (GdkDisplay *display,
|
||||
pointer_info->toplevel_x = x;
|
||||
pointer_info->toplevel_y = y;
|
||||
gdk_event_get_state (event, &pointer_info->state);
|
||||
}
|
||||
|
||||
if (event->type == GDK_BUTTON_PRESS ||
|
||||
event->type == GDK_BUTTON_RELEASE)
|
||||
pointer_info->button = event->button.button;
|
||||
|
Loading…
Reference in New Issue
Block a user