Skip to content

Re-fit the panel's window when it opens, and release 1.1.3 - #5

Merged
MylesShannon merged 1 commit into
mainfrom
panel-refit
Sep 14, 2026
Merged

MylesShannon merged 1 commit into
mainfrom
panel-refit

Conversation

@MylesShannon

Copy link
Copy Markdown
Owner

Moving from the laptop screen to an external monitor leaves a band of empty space above the panel, which stays until monitoring is switched off and on again.

Why

The window is re-fitted only when onGeometryChange reports a new height for the panel. A display change leaves the window wrong while the panel inside it is unchanged, so nothing fires. A log from an instrumented build shows the gap in the trigger directly — a second open produces a panel opened line and no height measured line:

12:46:19  height measured: content=257 panel=(2400,980 340x257) icon=(2708,1239 32x30) gapUnderIcon=2
12:46:19  panel opened:    content=257 panel=(2400,980 340x257) icon=(2708,1239 32x30) gapUnderIcon=2
12:46:30  panel opened:    content=257 panel=(2400,980 340x257) icon=(2708,1239 32x30) gapUnderIcon=2

Toggling monitoring clears it because that genuinely changes the height, from 239 points to 338 and back.

The fix

The measured height is kept, and opening the panel re-fits the window with it as well. The same log shows that being harmless when nothing is wrong: the shrink compares 257 against 257 and declines.

What is not proven

The gap itself has not been reproduced with this build. This fixes the trigger, which is certainly missing, on the assumption that the window is left too tall. If a display change instead leaves the window's top edge below the menu bar, the height would be right and this would change nothing; the instrumented build logs gapUnderIcon to tell those apart, and it reads 2 in the healthy case.

Test plan

  • Dock or undock, open the panel, and see no band above it
  • Toggling monitoring still resizes cleanly
  • The panel opens at the right size on the internal screen too

Moving from the laptop screen to a monitor left a band of empty space above the
panel until monitoring was switched off and on again. The window was being re-fitted
only when the panel's own height moved, and a display change leaves the window wrong
while the panel inside it is the same height as before, so nothing asked for a new
one. Toggling monitoring worked because that does change the height.

Opening the panel now re-fits as well, which a log from an instrumented build shows
is a no-op when the window is already right: the panel reports 257 points, the window
is 257, and the shrink declines.
@MylesShannon
MylesShannon merged commit 201f3ed into main Sep 14, 2026
2 checks passed
@MylesShannon
MylesShannon deleted the panel-refit branch September 14, 2026 17:04
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