Skip to content

Center a popped-out window again when it moves to another monitor - #14549

Merged
omarchybot merged 2 commits into
quattrofrom
fix/issue-7160
Oct 31, 2026
Merged

omarchybot merged 2 commits into
quattrofrom
fix/issue-7160

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

A window popped out with Super+O is centered on its monitor when it pops, but moving it to a workspace on another monitor (Super+Shift+N, or the silent Super+Shift+Alt+N) leaves it at the same offset from the new monitor's origin as it had from the old one. Hyprland translates a floating window across monitors that way and never re-centers it. On a monitor of a different size the window lands off-center, and on a smaller or portrait one it hangs partly off the screen: a 1300x900 pop-out centered on a 4K TV lands 1270px in on a 1440px-wide portrait monitor.

default/hypr/pop.lua listens for window.move_to_workspace and, for a window tagged pop whose destination workspace is on another monitor, centers it there. Hyprland 0.56.2 fires the event for a dispatcher move before the window has landed, while window.monitor still names the monitor it is leaving, so centering inside the handler would measure the old monitor; the center runs from a 1 ms oneshot timer instead, once the move is done. Moves between workspaces on the same monitor are left alone, as is a popped window dragged onto another monitor with the mouse: by the time a drag fires the event the window is already on its new monitor, so it stays where it was dropped. A window popped with explicit x y arguments is centered too when it changes monitor, since coordinates chosen for one monitor do not carry to another. Windows larger than their new monitor are still not shrunk to fit; that is #9731 and #9699.

Reproduced on an Omarchy worker running Hyprland 0.56.2 with a second, portrait 1440x2560 output: on quattro the pop-out moved from (240,163) on the first monitor to the same (240,163) offset on the second; with this change it lands centered at (320,1043). Reviewed by Codex at medium effort over two rounds; the second round found nothing open.

Fixes #7160

Hyprland carries a floating window to another monitor at its offset from the old monitor's origin, so a window popped out with Super+O lands off-center there, or partly off a smaller or portrait screen. A dispatcher move fires window.move_to_workspace before the window lands, so the center is deferred a loop; a mouse drag has already landed on its monitor by then and keeps where it was dropped.

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

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Centers popped-out windows after keyboard moves to another monitor.

  • Loads pop.lua with the Hyprland defaults.
  • Waits until the move finishes before centering the selected window.
  • Leaves same-monitor moves and untagged windows alone.
  • Adds tests for centering, delayed execution, and skipped moves.

The previous-review commits have different merge bases with the target commit, so this review covered the full PR diff. No previous review threads were supplied.

Reviews (2) · Last reviewed commit: "Merge quattro into the pop-out centering..." · Reviewed by Greptile

@omarchybot omarchybot added the bug Something isn't working label Oct 16, 2026
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 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

This had fallen out of merging cleanly with quattro, so quattro is now merged in as 82d233f. The only conflict was the require list in default/hypr/omarchy.lua, and both the new default.hypr.pop and quattro's default.hypr.dictation-backend are kept.

Re-verified at that head on an Omarchy worker running Hyprland 0.56.2, with a second, portrait 1440x2560 output. On quattro, and again with the pop require reverted, a window popped out with Super+O and moved to a workspace on the second monitor (Super+Shift+N or the silent Super+Shift+Alt+N) keeps its old offset and lands at (1270,-37), partly off the screen. At the head it lands centered at (1350,843). A move between workspaces on the same monitor leaves it where it was. Moving a whole workspace to the other monitor (Super+Shift+Alt+Arrow) leaves the pinned pop-out on its own monitor, still centered. ./test/cli passes, and so does hyprland-pop-test.sh. The rest of test/shell.d fails the same 80 checks on plain quattro on that worker (mostly node not installed), none of them in anything this touches.

Reviewed by Claude Opus 5.5 and by Codex at medium effort as a second opinion; neither found a defect. Codex checked the event timing, the timer and the center dispatcher against Hyprland 0.56.2's source, and found that this handler coexists with the existing window.move_to_workspace handlers in workspace-modes.lua and qconsole.lua. It agreed with the change, though its independence is not guaranteed. Codex also noted that the shipped test covers the handler's logic rather than the window's final position; the worker run above is what covers that.

This now waits on a maintainer's decision.

@omarchybot omarchybot removed verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 16, 2026
@omarchybot
omarchybot merged commit 60a912b into quattro Oct 31, 2026
2 checks passed
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
berenddeboer pushed a commit to berenddeboer/omarchy that referenced this pull request Nov 6, 2026
…acom#14549)

Hyprland carries a floating window to another monitor at its offset from the old monitor's origin, so a window popped out with Super+O lands off-center there, or partly off a smaller or portrait screen. A dispatcher move fires window.move_to_workspace before the window lands, so the center is deferred a loop; a mouse drag has already landed on its monitor by then and keeps where it was dropped.

Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Codex Medium <noreply@openai.com>
(cherry picked from commit 60a912b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Popped-out window (SUPER+O) loses centering when moved to another monitor

2 participants