Repository navigation
Re-fit the panel's window when it opens, and release 1.1.3 - #5
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
onGeometryChangereports 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 apanel openedline and noheight measuredline: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
gapUnderIconto tell those apart, and it reads 2 in the healthy case.Test plan