Repository navigation
fix(shell): prevent background stealing pointer grab during bar move (#16341) - #16409
hari45wavin wants to merge 1 commit into
Conversation
…macom#16341) When dragging the menu bar across the screen to change its edge, the pointer enters the background layershell surface. Background.qml kept a fullscreen MouseArea enabled without masking its input region, which intercepted the active grab and triggered onCanceled on CenterGestureArea. Set preventStealing on CenterGestureArea and release the background window's input mask and MouseArea while bar move or widget drag is active. Fixes omacom#16341
[Medium impact] The change affects pointer input during bar moves and widget drags. The runtime changes have no established defect, but the new tests must meet the repository's explicit requirements before merging. Findings
SummaryThis PR keeps the bar's pointer grab and releases background input while the user moves the bar or drags a widget.
|
| assert( | ||
| /mask:\s*Region\s*\{\s*item:\s*\(root\.barMoveActive \|\| root\.barDragActive\) \? null : bgMouseArea\s*\}/.test(backgroundQml), | ||
| 'background panel window releases input mask when bar drag or move is active' | ||
| ) | ||
| assert( | ||
| /enabled:\s*!root\.barMoveActive && !root\.barDragActive/.test(backgroundQml), | ||
| 'background mouse area disables while bar drag or move is active' | ||
| ) |
There was a problem hiding this comment.
Tests repeat the implementation
These assertions only search for the new QML bindings. They never start a drag or check whether the background stops receiving input, so broken state bindings can still pass. The new check in test/shell.d/bar-test.sh does the same for preventStealing.
This violates the contributor directive, “Don't restate the implementation.” Before merging, remove these checks or replace them with a test that starts a drag and checks the resulting input state.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks for working on this. I ran it on a disposable VM built from the Omarchy ISO, and it doesn't fix the drag yet. What was run. The worker served this branch's tree (
What it shows. On an empty desktop the bar gets Smaller points, from reading the code:
Second opinion. Codex Medium and muse-spark 1.3 (high thinking) compared this pull request with #12646. Neither had seen the worker result. Codex judged the input-mask approach plausible and preferred it. muse-spark judged that emptying the wallpaper's input region can't deliver the motion or the release back to the bar, which is what the worker showed. Both made the What happens next. #12646 is an older open fix for the same bug. It keeps the gesture alive by growing the moving bar's surface to cover the screen for the drag. It conflicts with |
Summary
Fixes #16341.
When moving the bar between screen edges,
CenterGestureAreabegins a bar move and tracks the pointer across the screen to compute the nearest target edge (nearestScreenEdge).When dragging across a desktop still wallpaper (such as custom wallpapers set by Aether or themes without video backgrounds), moving outside the 33px boundary of
BarPanelentered the background layershell window.Background.qmlmaintained an active fullscreenMouseAreaacceptingQt.LeftButtonwithout input region masking, causing the background surface to intercept/steal the pointer grab and triggeronCanceledonCenterGestureArea, aborting the bar relocation.Changes
preventStealing: trueonCenterGestureArea(andmodulePointerinModuleSlot) inshell/plugins/bar/Bar.qmlso active drags are preserved across layers.shell/plugins/background/Background.qml, dynamically mask the backgroundPanelWindowinput region to empty (mask: Region { item: (root.barMoveActive || root.barDragActive) ? null : bgMouseArea }) and disablebgMouseAreawhile a bar move or widget drag is in progress.test/shell.d/bar-test.shandtest/shell.d/background-test.shverifying input region mask release andpreventStealinggrab retention.Testing
./test/shell.d/bar-drag-test.sh: Passed (headless quickshell integration)./test/shell.d/bar-test.sh: Passed (82 assertions)./test/shell.d/background-test.sh: Passed (16 assertions)./test/cli: Passed (132/132 tests)