Skip to content

Stop the bar blinking after a monitor move, and polish the display panel - #17229

Merged
dhh merged 15 commits into
quattrofrom
monitor-panel-polish
Nov 1, 2026
Merged

dhh merged 15 commits into
quattrofrom
monitor-panel-polish

Conversation

@dhh

@dhh dhh commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Follow-ups to #17226.

No more blink after a monitor move. Moving a monitor in the display panel made the bar, dock and background vanish on that monitor for about a second. That was ScreenMoveRemap, which unmapped and remapped them on every move to work around Hyprland leaving layer surfaces at a moved monitor's old position. Hyprland 0.57 no longer does that: a plain Quickshell PanelWindow with no workaround follows its monitor both on a position change and when a neighbour is disabled (the undock case the workaround was written for). Checked with headless monitors, comparing hyprctl layers surface addresses and positions before and after. The workaround is gone, and so is the panel's half-second "Moving…" wait, which only warned about the blink.

One IPC handler per target. Every bar builds its own copy of a widget, so each IPC target had one handler per monitor, and Quickshell logged "Handler was registered but will not be used" for every extra one (14 targets per extra monitor). ShellIpc now enables only the first copy for its target, and the next takes over when that one goes. A handler that shouldn't answer leaves its target empty; an extra property would add a change signal, which Quickshell also warns about. The takeover is covered in shell-ipc-test.sh.

Display panel:

  • Ctrl+h/j/k/l arrange the shown display in every direction; plain h/j/k/l only move the cursor, as everywhere else. The key catcher takes Ctrl+h/l sideways only for a panel that opts in (reorderableSideways), so the agents panel's Ctrl+j/k is unchanged. Covered in panel-key-catcher's QML tests.
  • A quiet line under the layout map names its keys while it's hovered or the keyboard is on it.
  • Display commands queue instead of being dropped when one is still running, so a quick second move isn't lost.
  • Extend is now on the right of Mirror.

h/j/k/l like the arrows everywhere: the confirm dialog now switches buttons on h/l, and a closed dropdown, multi-select or searchable dropdown opens on j. Search fields still type them.

Acceptance test: monitor-panel-test.sh drives the layout map from the keyboard against a temporary headless monitor: the hint, Ctrl+j/k/l, and r → j → Enter rotating. It restores the saved monitor settings and original rotation afterwards. Mirroring can't run in the VM, since it has no built-in display. Not run yet: it needs qemu-full and a fresh VM base.

Reviewed with Codex; its findings (dropped rapid moves, test leaving saved settings behind) are fixed here.

Tested: ./test/shell (411 of 413; agent-account-exec-test.sh and config-test.sh fail on quattro too), plus shell-ipc, panel-key-catcher, dropdown, monitor and i18n after each change. Checked live: no surfaces recreated after a move, the bar follows its monitor, no QML errors or IPC warnings beyond a third-party plugin's, IPC still answers after a monitor comes and goes, the hint appears with the keyboard on the map, and the Mirror/Extend order.

🤖 Generated with Claude Code

dhh and others added 6 commits November 1, 2026 11:18
Hyprland used to leave a mapped layer surface at its monitor's old
position, so ScreenMoveRemap unmapped and remapped these windows on every
move. Hyprland 0.57 moves the surfaces with their monitor, both for a
position change and for a neighbour shifting when one is disabled, so the
remap only made the bar and dock vanish for a moment after every move in
the display panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every bar builds its own copy of a widget, so each IPC target had a
handler per monitor and Quickshell warned about every one past the
first, at each start and each monitor change. Now only the first copy
that wants the target enables itself, and the next takes over when it
goes, as when its monitor is unplugged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The half-second "Moving…" wait only warned of the blink while the bar and
dock were remapped after a move, which no longer happens. A dropped
display still stays where it was put until the state read catches up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
h/l, ctrl+j/k and r had no mention anywhere. A quiet line under the map
names them while it's hovered or the keyboard is on it; a lone or
mirrored map, which isn't a keyboard stop, names r while the Mirror and
Extend row is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A temporary second monitor gives the layout map something to arrange:
the hint shows when the keyboard reaches it, ctrl+j/k place the shown
display below and above, and r, j and Enter rotate it a quarter turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining test-coverage gap is non-blocking.

Findings

  1. P2 Takeover wiring is untested ▶

Summary

This PR removes the monitor-move remapping workaround and updates the display panel.

  • The bar, dock, and wallpaper follow moved screens without blinking.
  • The display panel runs quick changes in order without a waiting pause.
  • The display panel places a screen with Ctrl+h/j/k/l.
  • Each IPC target keeps one active handler and hands it over when needed.
  • Common controls respond to h and j like the rest of the shell.
  • Mirror comes first, and the picked display choice stands out.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Display action] --> B{Another action pending?}
  B -->|No| C[Run command]
  B -->|Yes| D[Queue action]
  C --> E{Next queued action}
  E -->|Command| C
  E -->|Move| F[Read fresh display state]
  F --> G[Calculate move with current sizes]
  G --> C
  E -->|None| H[Refresh panel state]
Loading

Reviews (5) · Last reviewed commit: "Work out a queued display move from the ..." · Reviewed by Greptile

Comment thread shell/plugins/panels/monitor/Panel.qml Resolved
Comment thread test/acceptance.d/monitor-panel-test.sh Resolved
Comment on lines +217 to +223
const leadsSource = registry.match(/function leads\(handler, revision\) \{[\s\S]*?\n \}/)[0]
const leadsWith = (handlers) => new Function('handlers', `${leadsSource}; return leads`)(handlers)
const first = { target: 'omarchy.monitor', active: true }
const second = { target: 'omarchy.monitor', active: true }
const other = { target: 'omarchy.audio', active: true }
const handlers = [first, second, other]
const leads = leadsWith(handlers)

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 Takeover wiring is untested

The added test calls leads() directly with plain JavaScript objects. It would still pass if ShellIpc stopped updating enabled, registering, or unregistering on destruction. Those connections are what let another handler take over when a monitor disappears.

Add a QML test with two real ShellIpc instances, remove or deactivate the leader, and check that both IPC paths reach the remaining handler.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in b1f29fa: a real Quickshell fixture with two ShellIpc handlers for one target checks that only the first answers, the second takes over once the first is destroyed, and Quickshell doesn't warn.

dhh and others added 5 commits November 1, 2026 11:33
Its active flag added an activeChanged signal, which Quickshell warns
about on an IPC handler. A handler that shouldn't answer now leaves its
target empty instead, and the registry passes it over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plain h/l moved the shown display sideways while up and down took ctrl.
Now ctrl+h/j/k/l arrange in every direction, and plain h/j/k/l only move
the cursor, as everywhere else. The key catcher takes ctrl+h/l sideways
only for a panel that asks, so the agents panel's ctrl+j/k reorder is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The confirm dialog switched buttons on Left/Right but not h/l, and a
closed dropdown opened on Down but not j. Search fields keep typing them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second layout key press or drop while the first move was still
applying started a Process that was already running, so it was lost:
the map showed it, then snapped back. Now each command waits its turn,
in order, and the state read follows the last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layout and rotate commands save what they set, so restoring only the
live arrangement left the test's last layout to come back on the next
config load. Put back the original rotation and the settings file too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread shell/plugins/panels/monitor/Panel.qml Resolved
dhh and others added 4 commits November 1, 2026 11:42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arriving on the row picked the current choice, which already reads in
bold accent, so nothing changed. Now it picks the other, the one Enter
switches to, and a hovered or picked choice turns bold instead of
underlined. The current one, already bold, takes a soft underline when
picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry test called leads() on plain objects, so it would still
pass if ShellIpc stopped registering or re-checking. Two real handlers
for one target now show that only the first answers, the second takes
over once the first is gone, and Quickshell never warns about it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A move queued behind a scale or rotation kept positions worked out from
the sizes before it, so after both ran the displays could overlap, saved
that way. A queued move now waits as the work to place it, and runs it
on a state read that started after everything before it landed. A read
already under way when a command ends reads again, so the map no longer
falls back to the arrangement from before the command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit 796e169 into quattro Nov 1, 2026
3 checks passed
@dhh
dhh deleted the monitor-panel-polish branch November 1, 2026 10:59
@emirb emirb added this to the 4.6.0 milestone Nov 5, 2026
nixfred added a commit to nixfred/infomarchy that referenced this pull request Nov 10, 2026
… where Omarchy ships it

@brentkearney found the load failure: Omarchy removed ScreenMoveRemap from
qs.Ui when Hyprland 0.57 began moving layer surfaces with their monitor
(omacom/omarchy#17229), and QML refuses a file that names an unknown type, so
the service plugin died with "ScreenMoveRemap is not a type" and neither the
desk nor the SUPER+D overlay loaded.

This merge keeps what the PR removes from the host files, the type name and the
qs.Ui import, but not the guard itself. Omarchy 4.5.0-3 here still ships the type
and uses it for its own bar, and its comment says Hyprland 0.56 and older can
leave a mapped layer at its old origin when a monitor moves (undock). The guard
moves behind a Loader by URL, the pattern BackgroundMedia already uses for the
same kind of version gap:

  RemapGuard.qml              the host-facing type; remapping is false if the
                              Omarchy type is absent
  OmarchyScreenMoveRemap.qml  the only file that names the Omarchy type

Verified in a Test Drive VM (Hyprland 0.56.2, Omarchy 4.0.2, 1280x800):
  - type present: the plugin loads and a monitor move remaps the desk surface
    (its layer address changes, and it lands at the new origin);
  - type unresolvable (wrapper edited in the VM copy): the plugin still loads,
    one warning per surface, the guard is off, IPC answers.
What I could NOT show: that 0.56.2 places the surface wrongly without the
guard. An undock sequence with virtual outputs (auto layout, one output
disabled) left the surface correctly placed with the guard off. So keeping it is
the no-risk default on the versions in use, not a proven need.

The lint gate whitelists the one version-dependent finding for the file that
names the type, so qml-resolve no longer depends on which Omarchy runs it (it
failed on a 0.57 Omarchy before this). info-ui.test.ts pins that the service and
overlay never name the type again. CHANGELOG gains the entries for #47, #48 and
#49, and the README agent list names Pi and Oh My Pi.

bun test: 687 pass, 0 fail, 44 files (661 before the five PRs).

Thanks @brentkearney.

LR-T: infomarchy, pr-merge, hyprland-0.57, screen-move-remap, loader, compat
LR-D: infomarchy, qml, hyprland
LR-K: ScreenMoveRemap, RemapGuard, Loader-by-URL, undock, pr-48
LR-L: law-9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXN1v41qZzqJGeH19PB8HC
aryanhv pushed a commit to Yakumy/Station that referenced this pull request Nov 10, 2026
…r Omarchy

Omarchy removed Ui.ScreenMoveRemap from the shell on 2026-11-01
(omacom/omarchy#17229). MonitorBar and WallpaperController still named
the host type, so on newer builds the bar fell back to omarchy.bar and the
service failed with "Ui.ScreenMoveRemap is not a type".

Keep a copy of the removed component in lib/platform and use it from both
owners. Behavior is unchanged on hosts that still ship the type.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants