#1151600 gtk+3.0: Wayland: stale pressed state when pointer leaves during implicit grab breaks press-drag-release in Firefox context menus

Package:
src:gtk+3.0
Source:
src:gtk+3.0
Submitter:
Paul Menzel
Date:
2026-10-22 08:19:02 UTC
Severity:
normal
Tags:
#1151600#5
Date:
2026-10-22 08:15:54 UTC
From:
To:
Dear Debian folks,


AI disclaimer: drafted by claude-opus-5.5 and edited by me

AI;dr: Please backport the commit from the accepted upstream merge
request [4].

On Wayland, GTK 3 keeps a stale implicit grab and pressed/active state
when the pointer leaves a surface while a button is still held. This can
happen legitimately, for example when the compositor takes the input on
button press, or when the pointer crosses between surfaces of the same
client. GTK 3 then never clears the state.

The most visible effect is in Firefox (and other Gecko applications such
as Thunderbird) running natively on Wayland, mainly with GNOME/mutter 49
and later [1]:

  1. Move the pointer over the first tab.
  2. Press and hold the right mouse button. The context menu opens.
  3. Move the pointer to "New Tab to Right".
  4. Release the button.

Expected: the menu item is activated.
Actual: nothing is activated, and hover highlights appear in the toolbar
or main window at wrong coordinates.

Running Firefox under XWayland (`MOZ_ENABLE_WAYLAND=0`) works around the
problem.

Mozilla closed their report as RESOLVED MOVED. The fix belongs in GTK 3,
and upstream merged it into the gtk-3-24 branch:

     commit a9f4db320a77afd1bc598691cfa44ca5609c277a
     Author: Martin Stransky <stransky@redhat.com>
     Date:   Thu May 21 09:09:09 2026 +0200

         gtkwindow: Clear active state on disappearing pointer

         If the pointer focus is considered to be no longer on the surface
         while there is an implicit grab, we were leaving the active state
         stale.
         [...]
         Part-of: <https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9956>

The change has 13 added lines in gdk/wayland/gdkdevice-wayland.c. In
pointer_handle_leave(), if buttons are still pressed, it clears
button_modifiers and ends the implicit device grab.

The fix is not in a release yet. According to the 3.24.52 NEWS, the next
GTK 3 release (3.24.53) is expected in March 2027 [2]. Fedora already
carries the same change as a downstream patch (9956_pointer_focus.patch
in rpms/gtk3) [3]. In comment 79 of the Mozilla bug, Martin Stránský
asks users to request this downstream patch from their distributions
[1]. It’d be great if Debian could do this.

trixie (3.24.49-3, mutter 48) probably has the same code. Most reports
start with GNOME 49, so I only list the sid/forky version as found.


Kind regards,

Paul


[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1984812
[2]:
https://gitlab.gnome.org/GNOME/gtk/-/blob/0f3aa454a2a14b68e2753f63bedb2c74bd45b54b/NEWS#L7-10
[3]:
https://src.fedoraproject.org/rpms/gtk3/blob/rawhide/f/9956_pointer_focus.patch
[4]: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9956