Skip to content

Close the launcher when its monitor disconnects - #103

Open
justcarlson wants to merge 1 commit into
typecraft-dev:mainfrom
justcarlson:fix/102-monitor-disconnect
Open

justcarlson wants to merge 1 commit into
typecraft-dev:mainfrom
justcarlson:fix/102-monitor-disconnect

Conversation

@justcarlson

Copy link
Copy Markdown

If the launcher's monitor goes away while the launcher is open (a dock drops, a cable is pulled), Hyprland stays in the omacast submap and every global bind is dead until omarchy-shell omacast hide. The surface never comes back either: on main, the next open reports isOpen true with 0 omacast layers, so the launcher is invisible and holds the submap again. Fixes #102.

  • On Quickshell.screens changes, if the pinned screen is gone, set mapped = false so the next open maps a fresh surface, and dismiss if shown. The existing onShownChanged path then resets the submap and cleans up, the same as Esc.
  • [D] Close rather than follow focus to another monitor, as the issue expects.
  • SPEC.md §2.0: the "mapped fresh on every open" line was stale; it now says the surface stays mapped and is remapped after a move or a lost monitor.

The proposal in #102 also cleared pinnedScreen. That is not needed: focusedScreen() pins a live screen on the next open. Dismissing alone is not enough: with it, the reopened launcher stays invisible (0 layers), so mapped = false is the part that matters.

Checked on Hyprland 0.56.2 and Quickshell 0.3.2, with a headless output as the lost monitor:

  • Lost while shown, lost while hidden, and twice in a row: after removal isOpen false and submap default; reopen gives 1 layer and submap omacast; close gives default.
  • Adding or removing a different monitor while open leaves the launcher open.
  • node --test tests/*.test.js (184 pass), omarchy plugin validate . (exit 0), qs log shows no omacast errors.

Not checked:

  • A physical dock unplug. The bug was found after one; the fix was tested with headless outputs.
  • tests/smoke.sh latency: it fails on my machine both on main (318 / 312 ms worst) and with this patch (345 / 328 ms), so it says nothing about this change.

Council review

Rounds: 2

Delegate Round 1 Round 2
Claude Opus 5.5 8/10 9/10
GPT 6.1 Sol 9/10 9/10
GPT 6.0 Astra 9/10 9/10

Created with Claude Opus 5.5 in Claude Code.

@paulnunezm

Copy link
Copy Markdown

I experienced intermittent loss of Super shortcuts and observed Hyprland in the omacast submap with no launcher visible. I did not capture the launcher's internal open state at the time, so I cannot confirm that a monitor disconnect triggered the original failures.

I applied the monitor-disconnect change locally and tested with a headless output. With the launcher open on that output, removing it closed the launcher and returned Hyprland to the default submap. The launcher then reopened and closed normally on the built-in display.

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.

Global keybindings stop working after the launcher's monitor is unplugged

2 participants