forked from AuroraMiddleware/gtk
gdk,xi2: Ensure scroll valuators are reset on window/device switch
This is in order to avoid scrolling glitches as the device causing scrolling to happen or the Window receiving the events changes.
This commit is contained in:
parent
377eb396a3
commit
013da47a07
@ -757,11 +757,13 @@ handle_device_changed (GdkX11DeviceManagerXI2 *device_manager,
|
||||
XIDeviceChangedEvent *ev)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDevice *device;
|
||||
GdkDevice *device, *source_device;
|
||||
|
||||
display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager));
|
||||
device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (ev->deviceid));
|
||||
source_device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (ev->sourceid));
|
||||
|
||||
if (device)
|
||||
{
|
||||
@ -770,6 +772,9 @@ handle_device_changed (GdkX11DeviceManagerXI2 *device_manager,
|
||||
|
||||
g_signal_emit_by_name (G_OBJECT (device), "changed");
|
||||
}
|
||||
|
||||
if (source_device)
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
|
||||
}
|
||||
|
||||
static GdkCrossingMode
|
||||
@ -1522,6 +1527,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
source_device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (xev->sourceid));
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
|
||||
|
||||
event->crossing.mode = translate_crossing_mode (xev->mode);
|
||||
event->crossing.detail = translate_notify_type (xev->detail);
|
||||
|
Loading…
Reference in New Issue
Block a user