Caffeine button: claim the right-click so the window menu stays away - #570
Conversation
Under GNOME on Wayland a right-click on the header's cup brought up the compositor's window menu (Take Screenshot, Minimize, Maximize, Close) instead of the durations popover. The button's secondary-click gesture popped the menu but never claimed the sequence, so the press bubbled on to the header bar's GtkWindowHandle, whose own gesture answers any secondary click with gdk_toplevel_show_window_menu; mutter never refuses that, and the window menu took the grab before our popover could show. The press is now claimed at the button, the way every other right-click menu in the app claims its gesture. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjbzS2d2W6G7TQJ33ugkiy
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjbzS2d2W6G7TQJ33ugkiy
|
@claude review |
|
Claude finished @ghackett's task in 1m 6s —— View job Review: Caffeine button right-click fix
Summary: This is a small, correct, well-scoped fix. No changes requested.
Testing note: I wasn't able to run |
|
🤖 Re the testing note in the review: CI has already run on the current head (65340c3). Lint, the unit suite, all five e2e shards and the fanned-in |
Right-clicking the header's Caffeine cup under GNOME on Wayland opened the compositor's window menu (Take Screenshot, Minimize, Maximize, Close) instead of the durations menu.
Cause. The button's
Gtk.GestureClick(button=SECONDARY)popped the durations popover onpressedbut never claimed the sequence, so the press kept bubbling up to the header bar'sGtkWindowHandle. That handle's own gesture answers any secondary click withgdk_toplevel_show_window_menu, which mutter never refuses, so the window menu took the grab and the popover (which pops a turn later) never showed. GTK's window-handle code is identical between 4.16 and 4.22, so this is not a GTK change; it is a compositor that always serves the menu. Every other right-click menu in the app already claims its gesture.Fix. The pressed handler now sets the sequence
CLAIMEDbefore showing the menu, inMainWindow._on_caffeine_secondary.Docs. A release note under v0.1.4 UNRELEASED in
docs/releases.md. The feature guide's description of the right-click menu is unchanged and was already accurate.Testing. ruff and the unit suite pass. There is no automated check: nothing in the e2e harness synthesizes a pointer press on the headless compositor. Please right-click the cup on the affected machine to confirm.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RjbzS2d2W6G7TQJ33ugkiy