popupMenu: allow modal grab when a compositor grab is active - #13942
Open
XM-71-HOPE wants to merge 1 commit into
Open
popupMenu: allow modal grab when a compositor grab is active#13942XM-71-HOPE wants to merge 1 commit into
XM-71-HOPE wants to merge 1 commit into
Conversation
Right-clicking the titlebar of a client-side-decorated app (VS Code, Opera, etc.) could leave a frozen window menu on screen. muffin is still holding a grab op when Cinnamon's popup machinery calls begin_modal(), so the modal grab is silently refused, the menu is shown without event capture, and nothing ever closes it. Pass META_MODAL_POINTER_GRABBED so the popup can go modal while muffin's transient grab op is active. Popup menus route input through Clutter stage capture and don't require an X pointer grab, so this only affects the check itself; menus opened without an active grab op behave identically. Fixes linuxmint#13931
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix is done by AI.
Summary
Right-clicking the titlebar of client-side-decorated (CSD) applications
(VS Code, Opera, etc.) on Cinnamon 6.6.x can leave the window menu
completely frozen: it appears but never responds to clicks. Right-clicking
another window's titlebar clears the ghost menu and displays a new one
but that new menu can also be a frozen one if you right-clicked the
titlebar of the same window; cinnamon --replace reliably recovers.
Root cause
When a CSD app's titlebar is right-clicked, the app forwards the request
to muffin, which is still holding a grab op when Cinnamon's popup machinery
runs.
PopupMenu.open()succeeds and the menu actor is shown, but thesynchronous
open-state-changed(true)dispatch reachesPopupMenuManager._grab(), whoseMain.pushModal()->global.begin_modal()is refused by muffin because a grab op is already in effect:
The grab is silently skipped (
grabbedstays false), no code path rollsthe menu back, and muffin releases its own grab a moment later — leaving a
visible menu with no modal grab and no event capture.
State captured while frozen:
Non-CSD windows don't hit this: muffin serves their titlebar right-click
synchronously, inside its own grab lifecycle.
Fix
Pass
Meta.ModalOptions.POINTER_ALREADY_GRABBEDtopushModalinPopupMenuManager._grab(). Popup menus go modal through Clutter stagecapture and don't require an X pointer grab, which is exactly what this
flag signals to muffin. It only changes behavior when a grab op is already
active, so normal menu paths are unaffected.
Verification
menu opens, accepts clicks, closes on outside click, and reopens
correctly every time.
pushModal: invocation of begin_modal failedin ~/.xsession-errors.Fixes #13931