mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
core: Do not update last device on CLUTTER_DEVICE_ADDED/REMOVED
We only update the last device from actual input interaction here, avoid this pair of events. This is specially nasty with CLUTTER_DEVICE_REMOVED, since the device we're notifying upon will be disposed soon after emission. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
This commit is contained in:
parent
16139efa5c
commit
86fa8aff4a
@ -205,7 +205,6 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
G_GNUC_UNUSED gboolean bypass_wayland = FALSE;
|
||||
MetaGestureTracker *gesture_tracker;
|
||||
ClutterEventSequence *sequence;
|
||||
ClutterInputDevice *source;
|
||||
|
||||
sequence = clutter_event_get_event_sequence (event);
|
||||
|
||||
@ -271,10 +270,17 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
if (event->type != CLUTTER_DEVICE_ADDED &&
|
||||
event->type != CLUTTER_DEVICE_REMOVED)
|
||||
{
|
||||
ClutterInputDevice *source;
|
||||
|
||||
handle_idletime_for_event (event);
|
||||
source = clutter_event_get_source_device (event);
|
||||
|
||||
if (source)
|
||||
meta_backend_update_last_device (backend, source);
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (meta_is_wayland_compositor () && event->type == CLUTTER_MOTION)
|
||||
@ -299,8 +305,6 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
}
|
||||
#endif
|
||||
|
||||
handle_idletime_for_event (event);
|
||||
|
||||
window = get_window_for_event (display, event);
|
||||
|
||||
display->current_time = event->any.time;
|
||||
|
Loading…
Reference in New Issue
Block a user