Skip to content

Clear a stuck bar-move ghost when the gesture is interrupted - #7563

Open
calledtoconstruct wants to merge 4 commits into
omacom:quattrofrom
calledtoconstruct:fix-7276-bar-move-ghost
Open

calledtoconstruct wants to merge 4 commits into
omacom:quattrofrom
calledtoconstruct:fix-7276-bar-move-ghost

Conversation

@calledtoconstruct

Copy link
Copy Markdown

Summary

  • Cancels an in-progress bar-move when the center gesture area is destroyed, when the pointer grab is dropped without released/canceled, and on a later press if the overlay is still up.
  • The omarchy-bar-move-ghost layer was staying mapped after a mid-gesture reload/remap, which left a checkered slab over the bar for the rest of the session.

Fixes #7276

Test plan

  • bash test/shell.d/bar-test.sh
  • Press-and-hold the empty bar center, drag to another edge, release — bar moves and the ghost unmaps.
  • Start a bar-move drag, then change bar position (or reload the shell config) while still holding; release — hyprctl layers has no omarchy-bar-move-ghost.
  • If a leftover ghost is already up, click the bar — overlay dismisses without a 200ms hold.

Copilot AI balanced review requested due to automatic review settings August 20, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes #7276 by reliably dismissing the bar-move ghost after interrupted gestures.

Changes:

  • Clears stale move state on destruction, dropped grabs, and subsequent presses.
  • Adds regression checks for each cleanup path.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
shell/plugins/bar/Bar.qml Adds fallback gesture cleanup paths.
test/shell.d/bar-test.sh Verifies the new cleanup safeguards.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed, reproduced on a worker, and fixed up with one small commit.

The bug is real, and this fixes it. On a worker built from the Omarchy ISO, with the shell running from each tree, I pressed and held the empty bar centre until the move started, switched bar.position to left while still holding, then released. On quattro (b686ed8), omarchy-bar-move-ghost stayed mapped after the release, and clicking the bar didn't clear it. On this branch it unmapped as soon as the position changed. With Component.onDestruction removed, the ghost stuck again, and a single click on the bar then dismissed it, so the onPressed recovery works too. A normal hold and release, and the double-click transparency toggle, still work.

Pushed 8b99b9d, which removes the onPressedChanged / Qt.callLater block and its assertion. Qt emits released before pressedChanged on a release, and canceled before it when the grab is lost. So dragging was always already false when the handler ran, and it never scheduled anything. I checked this with logging on the worker, and it matches Qt's QQuickMouseArea source. The two remaining assertions in test/shell.d/bar-test.sh now require root.clearBarMove() with the call parentheses. Before, a bare root.clearBarMove, which does nothing, also passed them.

Tests, on the worker at 8b99b9d: test/shell.d/bar-test.sh 90 passed, and ./test/cli passed. The new assertion fails when the onDestruction call is broken.

Second opinion: Codex at medium effort. It found the dead handler and the too-loose assertions independently. Both are fixed above. Its second round on 8b99b9d found nothing. It could read this session's working, so its agreement isn't guaranteed independent.

This is waiting on the maintainer. Fixes #7276.

calledtoconstruct and others added 2 commits September 30, 2026 09:36
The overlay stays mapped when a reload, remap, or dropped grab tears down the gesture area without released or canceled. Cancel the move on destruction, after a lost press, and on a later click so omarchy-bar-move-ghost cannot outlive the gesture.

Fixes omacom#7276
Qt emits released before pressedChanged on a release, and canceled before pressedChanged when the grab is lost, so by the time this handler ran dragging was always already false and it returned without scheduling anything. Watched on a worker: released fires first with dragging still true, then pressedChanged with it false.

The remaining assertions now require the call, root.clearBarMove(), rather than the bare name, which a no-op reference also matched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@calledtoconstruct
calledtoconstruct force-pushed the fix-7276-bar-move-ghost branch 2 times, most recently from 8b99b9d to a888bc5 Compare September 30, 2026 13:36
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the remaining runtime-test suggestion is non-blocking.

Findings

  1. P2 Gesture behavior remains untested ▶

Summary

Clears leftover bar-move previews in two places:

  • Interrupted bar moves clear their ghost overlay.

Reviews (3) · Last reviewed commit: "Merge quattro into fix-7276-bar-move-gho..." · Reviewed by Greptile

Comment thread test/shell.d/bar-test.sh Outdated
Comment on lines +36 to +42
if ! perl -0ne 'exit(/component CenterGestureArea: MouseArea \{.*?Component\.onDestruction:\s*if\s*\(\s*dragging\s*\)\s*root\.clearBarMove\(\)/s ? 0 : 1)' \
"$ROOT/shell/plugins/bar/Bar.qml"; then
fail "bar move clears when the gesture area is destroyed mid-drag"
fi
pass "bar move clears when the gesture area is destroyed mid-drag"

if ! perl -0ne 'exit(/component CenterGestureArea: MouseArea \{.*?onPressed:\s*function[^{]*\{[^}]*barMoveActive[^}]*root\.clearBarMove\(\)/s ? 0 : 1)' \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Gesture behavior remains untested These checks only look for cleanup statements in the QML source. They would still pass if destroying the gesture area failed to clear an active ghost, or if the next press failed to dismiss it. A runtime test of those interrupted-gesture paths would catch regressions that these checks cannot.

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!

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 30, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-verified after the rebase onto quattro 8b4eae6. Both commits are unchanged. Bar.qml changed a lot underneath them, so I ran the reproduction again from scratch, and the fix still holds.

Reproduction, on a worker built from the Omarchy ISO with the shell running from each tree. A real pointer pressed and held the empty bar centre until the move ghost appeared. Then bar.position was switched to left while the button was still down, the button was released, and the bar was clicked once:

  • quattro (8b4eae6): omarchy-bar-move-ghost stayed mapped after the release and after the click.
  • This branch (a888bc5): the ghost unmapped as soon as the position changed.
  • This branch with Component.onDestruction removed: the ghost stuck, and the click then dismissed it. So the onPressed recovery works on its own too.

Tests at a888bc5: test/shell.d/bar-test.sh passes 90 of 90, and its new destruction assertion fails with that line removed. ./test/cli fails one test, vscode generated theme references current theme file, and it fails the same way on quattro itself. #10134 made omarchy-theme-set-vscode write a real file on purpose, but test/cli:607 still expects a symlink. Nothing in this pull request touches it.

On the Greptile note: it's right that the two new assertions check the source text, not the behaviour, like the rest of bar-test.sh. They would still pass with the destruction line commented out, or with the press condition inverted. The behaviour itself is what the reproduction above checked.

Second opinion: Codex at medium effort reviewed this head against the new base and found no defect in the change. It also flagged the same weakness in the assertions. It could read this session's working, so its agreement isn't guaranteed to be independent.

This isn't ready yet because the test suite doesn't pass. The failure comes from the stale quattro test, not from this change, so it's waiting on the maintainer. Fixes #7276.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 4, 2026
The only conflict was in test/shell.d/bar-test.sh, where quattro added its plugin api and indicator assertions at the same spot this branch added its gesture assertions; both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 7, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging into quattro, so I pushed bd036fb, which merges quattro 982290f into it. The only conflict was in test/shell.d/bar-test.sh: quattro had added its plugin api and indicator assertions in the same place as your two gesture assertions, and the merge keeps both. Against quattro, the change is still the same seven lines in Bar.qml plus the two assertions.

Reproduction, on a worker built from the Omarchy ISO, with the shell running from each tree. A real pointer pressed and held the empty bar centre until the move ghost appeared. Then bar.position was switched to left while the button was still down, the button was released, and the empty part of the left bar was clicked once:

  • quattro (982290f): omarchy-bar-move-ghost stayed mapped after the release and after the click.
  • This branch (bd036fb): the ghost unmapped as soon as the position changed.
  • This branch with Component.onDestruction removed: the ghost stuck, and the click dismissed it. So the onPressed recovery also works on its own.

Tests at bd036fb: test/shell.d/bar-test.sh passed 92 of 92, and ./test/cli passed. The vscode test that failed last time is fixed on quattro. With the onDestruction line removed, the new destruction assertion fails.

Second opinion: Codex at medium effort reviewed the merge and this head against the new base. It found no defect. It checked that nothing from either side of the conflict was lost, and that the newer Bar.qml work (#11015, #14267) doesn't create another owner for the move or clear barMoveActive elsewhere. It could read this session's working, so its agreement isn't guaranteed to be independent.

This is waiting on the maintainer. Fixes #7276.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 27, 2026
quattro removed the bar's source-reading tests in omacom#16334, and AGENTS.md now rules them out, so the conflict in bar-test.sh resolves to quattro's file and drops the two regex checks this branch had added. The fix in Bar.qml merges cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot omarchybot added the ready Good to merge label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging into quattro again, so I pushed b86d798, which merges quattro e4fffc6 into it. The conflict was in test/shell.d/bar-test.sh: quattro removed the bar's source-reading tests in #16334, and its AGENTS.md now rules out tests that grep for the lines a change adds. So the merge takes quattro's file, which drops your two regex assertions. Against quattro, the change is now the seven lines in Bar.qml and nothing else.

Reproduction, on a worker built from the Omarchy ISO, with the shell running from each tree. A real pointer held the empty bar centre until the move ghost appeared. Then bar.position was switched to left with the button still down, the button was released, and the bar was clicked:

  • quattro (e4fffc6): omarchy-bar-move-ghost stayed mapped after the release and after the click.
  • This branch (b86d798): the ghost unmapped as soon as the position changed.
  • This branch with Component.onDestruction removed: the ghost stuck, as on quattro.

One result is different from last time. With onDestruction removed, a click on the empty bar no longer dismissed the leaked ghost. Logging in onPressed showed the press never reached CenterGestureArea once the move had leaked. A fresh shell does get the press, and workspace buttons still worked. So on today's bar, the onPressed guard doesn't recover from this leak, and onDestruction is what fixes it. The guard is harmless, and it may still help with a leak from some other path, so I left it in. root.beginBarMove has a single caller, the gesture area's own startDrag, so the guard cannot cancel a move started some other way.

The description still says the change handles "the pointer grab is dropped without released/canceled". That handler was taken out in a888bc5, so you may want to edit that line.

Tests at b86d798: test/shell.d/bar-test.sh passed 238 of 238, ./test/cli passed, and CI is green.

Second opinion: Codex at medium effort and muse-wonder (via pi, thinking high) both reviewed the merge and this head. Neither found a defect. Both confirmed that nothing else from either side of the merge was lost, that onDestruction cannot clear another area's move, and that the onPressed guard is harmless but does not fire in the reproduced failure. Neither could explain from the source why presses stop reaching the gesture area after a leak. They could read this session's notes, so their agreement isn't guaranteed to be independent.

This is waiting on the maintainer. Fixes #7276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bar shows a checkered overlay after an interrupted bar-move gesture — omarchy-bar-move-ghost layer stays stuck open

3 participants