From 7b5c915c8c85666bbe9e20c753f9cfa3d4207c97 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 18 Jul 2026 21:23:09 -0700 Subject: [PATCH] Clear bar move outline on release --- shell/plugins/bar/Bar.qml | 19 ++----------------- test/shell.d/bar-test.sh | 5 +++++ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/shell/plugins/bar/Bar.qml b/shell/plugins/bar/Bar.qml index a9277b93..e3511ea0 100644 --- a/shell/plugins/bar/Bar.qml +++ b/shell/plugins/bar/Bar.qml @@ -86,7 +86,6 @@ Item { property real barDragOffsetX: 0 property real barDragOffsetY: 0 property bool barMoveActive: false - property bool barMoveSettling: false property string barMoveCandidate: "" property var barMoveWindow: null property var barMoveScreen: null @@ -223,8 +222,6 @@ Item { } function beginBarMove(window) { - barMoveSettleTimer.stop() - barMoveSettling = false barMoveWindow = window barMoveScreen = window ? window.screen : null barMoveCandidate = position @@ -237,9 +234,7 @@ Item { } function clearBarMove() { - barMoveSettleTimer.stop() barMoveActive = false - barMoveSettling = false barMoveCandidate = "" barMoveWindow = null barMoveScreen = null @@ -252,20 +247,10 @@ Item { return } - // Hold the ghost on the target edge while the config round-trips and the - // bar re-anchors, so the handoff doesn't flash an empty edge. - barMoveActive = false - barMoveSettling = true - barMoveSettleTimer.restart() + clearBarMove() setBarPosition(edge) } - Timer { - id: barMoveSettleTimer - interval: 450 - onTriggered: root.clearBarMove() - } - function setBarPosition(value) { var next = normalizePosition(value) if (root.shell && typeof root.shell.mutateShellConfig === "function") { @@ -1069,7 +1054,7 @@ Item { required property var ghostScreen readonly property bool screenMatches: root.barMoveScreen === ghostScreen || (root.barMoveScreen && ghostScreen && root.barMoveScreen.name && ghostScreen.name && root.barMoveScreen.name === ghostScreen.name) - visible: (root.barMoveActive || root.barMoveSettling) && screenMatches + visible: root.barMoveActive && screenMatches color: "transparent" exclusionMode: ExclusionMode.Ignore WlrLayershell.namespace: "omarchy-bar-move-ghost" diff --git a/test/shell.d/bar-test.sh b/test/shell.d/bar-test.sh index 679b6a5f..99cb26cd 100644 --- a/test/shell.d/bar-test.sh +++ b/test/shell.d/bar-test.sh @@ -9,6 +9,11 @@ if perl -0ne 'exit(/drag\s*\.\s*target\s*:\s*[^;]*\bslot\b/s ? 0 : 1)' "$ROOT/sh fi pass "bar module dragging leaves layout-managed slots in place" +if rg -q 'barMoveSettling|barMoveSettleTimer' "$ROOT/shell/plugins/bar/Bar.qml"; then + fail "bar move outline must clear when the pointer is released" +fi +pass "bar move outline has no post-release settling state" + run_node_test <<'JS' const bar = requireFromRoot('shell/plugins/bar/BarModel.js')