Skip to content

Persist floating window size and position between sessions - #91

Open
robert-corlett wants to merge 1 commit into
f:masterfrom
robert-corlett:floating-window-persist-frame
Open

Persist floating window size and position between sessions#91
robert-corlett wants to merge 1 commit into
f:masterfrom
robert-corlett:floating-window-persist-frame

Conversation

@robert-corlett

Copy link
Copy Markdown

Adds persistence to the floating window size and position - see issue #90

The floating overlay was always recreated at a centered default frame, so any manual resize or reposition was lost when the session ended.

The panel frame is stored in NotchSettings whenever the window is moved or resized, and the panel is constructed with that frame so the content lays out against its final size immediately. The saved size is restored as-is; only the origin is constrained, so the window cannot come back with an edge past the display, and a frame whose center no longer lands on a connected display is discarded in favour of the default.

The stored frame is marked @ObservationIgnored: nothing renders from it, and it is written on every drag and resize step, which would otherwise redraw the overlay continuously while the window is being dragged.

  • Tested with an applie silicon build, no codesigning
  • Floating window position persists
  • Floating window size persists

The floating overlay was always recreated at a centered default frame, so any
manual resize or reposition was lost when the session ended.

The panel frame is stored in NotchSettings whenever the window is moved or
resized, and the panel is constructed with that frame so the content lays out
against its final size immediately. The saved size is restored as-is; only the
origin is constrained, so the window cannot come back with an edge past the
display, and a frame whose center no longer lands on a connected display is
discarded in favour of the default.

The stored frame is marked @ObservationIgnored: nothing renders from it, and it
is written on every drag and resize step, which would otherwise redraw the
overlay continuously while the window is being dragged.
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.

1 participant