[mutter/wip/carlosg/ignore-device-events: 5/6] core: Do not update last device on CLUTTER_DEVICE_ADDED/REMOVED
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/ignore-device-events: 5/6] core: Do not update last device on CLUTTER_DEVICE_ADDED/REMOVED
- Date: Wed, 30 Sep 2020 18:26:21 +0000 (UTC)
commit 86fa8aff4aabf53c125691a44a464cacc25bcb28
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Sep 25 18:49:19 2020 +0200
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
src/core/events.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/core/events.c b/src/core/events.c
index 83ebc68b58..438beda5cb 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -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,
}
}
- source = clutter_event_get_source_device (event);
+ 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);
+ 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]