public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Ondrej Holy <oholy@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mutter] main: wayland: Only schedule a single cursor location update
Date: Mon, 22 Jun 2026 08:39:05 GMT	[thread overview]
Message-ID: <178211754536.1.15963657510656964837.rpms-mutter-e59fd1fdee26@fedoraproject.org> (raw)

            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
+

                 reply	other threads:[~2026-06-22  8:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178211754536.1.15963657510656964837.rpms-mutter-e59fd1fdee26@fedoraproject.org \
    --to=oholy@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox