[mutter/gnome-3-36] core: Do not update last device on CLUTTER_DEVICE_ADDED/REMOVED
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-36] core: Do not update last device on CLUTTER_DEVICE_ADDED/REMOVED
- Date: Wed, 7 Oct 2020 17:55:22 +0000 (UTC)
commit 9042716c4bddfc38526519d3623f01bcc46987a3
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
(cherry picked from commit 86fa8aff4aabf53c125691a44a464cacc25bcb28)
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 47b97c3281..e50b52d0d7 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -206,7 +206,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);
@@ -272,10 +271,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)
@@ -302,8 +308,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]