public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/mutter] main: wayland: Only schedule a single cursor location update
@ 2026-06-22  8:39 Ondrej Holy
  0 siblings, 0 replies; only message in thread
From: Ondrej Holy @ 2026-06-22  8:39 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/mutter
            Branch : main
            Commit : e59fd1fdee26f7e1eee24e3a7e5c611342796d35
            Author : Ondrej Holy <oholy@redhat.com>
            Date   : 2026-06-22T10:33:59+02:00
            Stats  : +70/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/mutter/c/e59fd1fdee26f7e1eee24e3a7e5c611342796d35?branch=main

            Log:
            wayland: Only schedule a single cursor location update

Backport of commit f1570318ec3e9a38615eb91708bb71628ab8bcfd to prevent
`clutter_input_focus_set_cursor_location: assertion
'CLUTTER_IS_INPUT_FOCUS (focus)' failed` warnings.

---
diff --git a/mutter.spec b/mutter.spec
index 91c35fb..7c0ca63 100644
--- a/mutter.spec
+++ b/mutter.spec
@@ -27,6 +27,10 @@ License:       GPL-2.0-or-later
 URL:           http://www.gnome.org
 Source0:       http://download.gnome.org/sources/%{name}/%{major_version}/%{name}-%{tarball_version}.tar.xz
 
+# wayland: Only schedule a single cursor location update
+# https://gitlab.gnome.org/GNOME/mutter/-/commit/f1570318ec3e9a38615eb91708bb71628ab8bcfd
+Patch:         wayland-only-schedule-a-single-cursor-location-update.patch
+
 BuildRequires: cvt
 BuildRequires: desktop-file-utils
 BuildRequires: mesa-libEGL-devel

diff --git a/wayland-only-schedule-a-single-cursor-location-update.patch b/wayland-only-schedule-a-single-cursor-location-update.patch
new file mode 100644
index 0000000..7a084ca
--- /dev/null
+++ b/wayland-only-schedule-a-single-cursor-location-update.patch
@@ -0,0 +1,66 @@
+From f1570318ec3e9a38615eb91708bb71628ab8bcfd Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Sun, 31 May 2026 11:23:06 +0200
+Subject: [PATCH] wayland: Only schedule a single cursor location update
+
+If the cursor is updated multiple times before the state is applied
+on the surface, the newer signal handled would overwrite the ID of
+the previous.
+
+We can coalesce these calls and keep just the last value with the
+already existing signal handler, add a check to make sure we don't
+add a second signal handler if there's one pending already.
+
+Fixes (harmless) warnings like:
+
+clutter_input_focus_set_cursor_location: assertion 'CLUTTER_IS_INPUT_FOCUS (focus)' failed
+
+When a second handler would stumble upon already cleared data.
+Easily reproducible when a VTE widget has the IM focus, but there
+may be other cases.
+
+Closes: https://gitlab.gnome.org/GNOME/mutter/-/work_items/4840
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5096>
+---
+ src/wayland/meta-wayland-text-input.c | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c
+index ab635fda71d..a8fe13fa893 100644
+--- a/src/wayland/meta-wayland-text-input.c
++++ b/src/wayland/meta-wayland-text-input.c
+@@ -831,8 +831,11 @@ update_cursor_location (MetaWaylandSurface *surface,
+ {
+   MetaWaylandTextInput *text_input = user_data;
+ 
+-  clutter_input_focus_set_cursor_location (text_input->cursor_update.focus,
+-                                           &text_input->cursor_update.rect);
++  if (clutter_input_focus_is_focused (text_input->cursor_update.focus))
++    {
++      clutter_input_focus_set_cursor_location (text_input->cursor_update.focus,
++                                               &text_input->cursor_update.rect);
++    }
+ 
+   g_clear_object (&text_input->cursor_update.focus);
+   graphene_rect_init (&text_input->cursor_update.rect, 0, 0, 0, 0);
+@@ -936,10 +939,13 @@ text_input_commit_state (struct wl_client   *client,
+       graphene_rect_init (&text_input->cursor_update.rect,
+                           x1, y1, x2 - x1, y2 - y1);
+ 
+-      text_input->cursor_update.signal_id =
+-        g_signal_connect (text_input->surface, "pre-state-applied",
+-                          G_CALLBACK (update_cursor_location),
+-                          text_input);
++      if (text_input->cursor_update.signal_id == 0)
++        {
++          text_input->cursor_update.signal_id =
++            g_signal_connect (text_input->surface, "pre-state-applied",
++                              G_CALLBACK (update_cursor_location),
++                              text_input);
++        }
+     }
+ 
+   if (text_input->pending_state & META_WAYLAND_PENDING_STATE_ACTIONS)
+-- 
+GitLab
+

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-22  8:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-22  8:39 [rpms/mutter] main: wayland: Only schedule a single cursor location update Ondrej Holy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox