Skip to content

fix(desktop): reopen a slot window on the screen its frame was saved on - #53

Open
nsaintot wants to merge 1 commit into
mainfrom
fix/window-screen
Open

nsaintot wants to merge 1 commit into
mainfrom
fix/window-screen

Conversation

@nsaintot

@nsaintot nsaintot commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

On macOS, setFrameUsingName: puts a saved window frame on the screen that has the focus. A slot launched from a window on another display therefore opened on that display instead of the one it was saved on.

Changes

  • Read AppKit's saved frame string (NSWindow Frame <key>) before setFrameUsingName: rewrites it. The string holds the window frame and the frame of the screen it was on, without the menu bar.
  • After the restore, move the window back to that screen when it is still connected. The screen is matched by origin and size, or by size alone when the displays were rearranged and only one screen has that size.
  • When no screen matches, AppKit's placement is kept.
  • Unit tests cover parsing the saved string and matching a screen to its saved size.

Testing

  • With two displays, a slot saved on the external display and launched from a slot on the built-in display opens on the external display. The reverse case also works.

setFrameUsingName: moves a saved frame onto the screen that has the focus, so a slot launched from a window on another display opened there. Read the saved frame string first and move the window back to the screen recorded in it when that screen is still connected.

This branch was successfully deployed

1 active deployment
e2e — ec475381 Deployed Nov 18, 2026 by nsaintot via E2E (Linux aarch64) #64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant