From b590b4c640db2bb24bfb74e2f0c1de7774b5c840 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 9 Aug 2023 16:30:50 +0200 Subject: [PATCH] Backport #3168 to fix mouse clicks sometimes going missing This is a backport of an upstream MR that replaces earlier downstream revert of "compositor: Do not repick after effects finish". https://gitlab.gnome.org/GNOME/mutter/-/issues/2918 --- ...r-Do-not-repick-after-effects-finish.patch | 43 ---------------- 3168.patch | 51 +++++++++++++++++++ mutter.spec | 5 +- 3 files changed, 54 insertions(+), 45 deletions(-) delete mode 100644 0001-Revert-compositor-Do-not-repick-after-effects-finish.patch create mode 100644 3168.patch diff --git a/0001-Revert-compositor-Do-not-repick-after-effects-finish.patch b/0001-Revert-compositor-Do-not-repick-after-effects-finish.patch deleted file mode 100644 index fa0e7ef..0000000 --- a/0001-Revert-compositor-Do-not-repick-after-effects-finish.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 3bb8445dbdd5600a8ce115a2e82a527f32246c13 Mon Sep 17 00:00:00 2001 -From: Kalev Lember -Date: Tue, 8 Aug 2023 17:15:34 +0200 -Subject: [PATCH] Revert "compositor: Do not repick after effects finish" - -Revert a change that likely caused mouse clicks to go missing in openQA -tests. - -https://gitlab.gnome.org/GNOME/mutter/-/issues/2918#note_1810692 - -This reverts commit 281d896f6ad30b114f17b0ac6eb1eaf6f394e956. ---- - src/compositor/meta-window-actor.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c -index f5bed5166..07d005cef 100644 ---- a/src/compositor/meta-window-actor.c -+++ b/src/compositor/meta-window-actor.c -@@ -683,6 +683,11 @@ meta_window_actor_after_effects (MetaWindowActor *self) - { - MetaWindowActorPrivate *priv = - meta_window_actor_get_instance_private (self); -+ ClutterStage *stage; -+ ClutterSeat *seat; -+ -+ stage = CLUTTER_STAGE (clutter_actor_get_stage (CLUTTER_ACTOR (self))); -+ seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); - - if (priv->needs_destroy) - { -@@ -694,6 +699,8 @@ meta_window_actor_after_effects (MetaWindowActor *self) - meta_window_actor_sync_visibility (self); - meta_window_actor_sync_actor_geometry (self, FALSE); - } -+ -+ clutter_stage_repick_device (stage, clutter_seat_get_pointer (seat)); - } - - void --- -2.41.0 - diff --git a/3168.patch b/3168.patch new file mode 100644 index 0000000..03d5f4d --- /dev/null +++ b/3168.patch @@ -0,0 +1,51 @@ +From 44fc67626b6dbaee79c49fd87b20c42405d9decc Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Wed, 9 Aug 2023 16:00:49 +0200 +Subject: [PATCH] clutter: Trigger repick on animation-less transform changes + +We have a mechanism to trigger repick after animations on +clutter_actor_set_final_state(), but this will not happen if +animations are disabled. + +In this case, shell transitions and other typically animatable +changes on the transform of actors will not naturally trigger +a pointer repick when those get instantly changed to the final +state, possibly preserving the cached state and missing the +just popped in actor altogether. + +Trigger an instant repick on animation-less transform changes, +so that these situations are also handled correctly, and the +pointer drops the cached state and is able to find the new +actor. + +Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2918 +--- + clutter/clutter/clutter-actor.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c +index 99b42cfe9d..8495e06f79 100644 +--- a/clutter/clutter/clutter-actor.c ++++ b/clutter/clutter/clutter-actor.c +@@ -1004,6 +1004,8 @@ static void push_in_paint_unmapped_branch (ClutterActor *self, + static void pop_in_paint_unmapped_branch (ClutterActor *self, + guint count); + ++static void clutter_actor_update_pointer (ClutterActor *self); ++ + static GQuark quark_actor_layout_info = 0; + static GQuark quark_actor_transform_info = 0; + static GQuark quark_actor_animation_info = 0; +@@ -2447,6 +2449,9 @@ transform_changed (ClutterActor *actor) + absolute_geometry_changed_cb, + NULL, + NULL); ++ ++ if (!clutter_actor_has_transitions (actor)) ++ clutter_actor_update_pointer (actor); + } + + /*< private > +-- +GitLab + diff --git a/mutter.spec b/mutter.spec index fc9e5f7..6644269 100644 --- a/mutter.spec +++ b/mutter.spec @@ -35,8 +35,9 @@ Patch2: 0001-place-Always-center-initial-setup-fedora-welcome.patch # https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3162 Patch3: 3162.patch -# https://gitlab.gnome.org/GNOME/mutter/-/issues/2918#note_1810692 -Patch4: 0001-Revert-compositor-Do-not-repick-after-effects-finish.patch +# Fix mouse clicks sometimes not working +# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3168 +Patch4: 3168.patch BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0 BuildRequires: pkgconfig(sm)