Adapt size of Dialogs based on default size upon zoom change#3464
Merged
akoch-yatta merged 1 commit intoNov 5, 2025
Merged
Conversation
Contributor
81f9a56 to
ed54d07
Compare
ed54d07 to
74614be
Compare
When moved between monitors of different zoom, Dialogs may not show their full contents anymore. This is caused by their shell and the used fonts being linearly scaled in size according to the zoom, even though font size and required area for a font of a size are not linearly related. I.e., a font of double the size required more than double of the width and height. Since there are many ways to customize Dialogs and their sizes/layouts during and after initialization, it's difficult to solve that problem in general. It is, however, most severe for Dialogs that use the default calculated size and are not resizable, as those Dialogs do not have sophisticated layouts that adapt to the limited space and may easily lead to cut offs the user cannot work around by resizing. Thus, this change adds according zoom change and resize listeners to identify if a Window uses the default computed size and, in that case, recomputes it upon zoom change.
74614be to
b97616e
Compare
akoch-yatta
approved these changes
Nov 3, 2025
akoch-yatta
left a comment
Contributor
There was a problem hiding this comment.
The code to detect whether the dialog should be automatically resized or not is quite complex, but I do not see an easier way to achieve that. I would weigh the improved UX higher and approve it.
I tested the approach with different dialogs and it improves the UX for all dialogs I tested for that are affected by cut-off text. I did not experience any unwanted dialog resizing.
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.
When moved between monitors of different zoom,
Dialogs may not show their full contents anymore. This is caused by their shell and the used fonts being linearly scaled in size according to the zoom, even though font size and required area for a font of that size are not linearly related. I.e., a font of double the size requires more than double of the width and height.Since there are many ways to customize
Dialogs and their sizes/layouts during and after initialization, it's difficult to solve that problem in general (also see #3212). The problem is, however, most severe forDialogs that use the default calculated size and are not resizable, as thoseDialogs do not have sophisticated layouts that adapt to the limited space in a shell and may easily lead to cut offs the user cannot work around by resizing the dialog. Thus, this change adds according zoom change and resize listeners to identify if exactly suchDialogs that use the default computed size and, in that case, recomputes it upon a zoom change.This is supposed to be a conservative alternative to #3212
How to test
On a Windows system, the behavior can particularly be seen in any dialog in which the number of text lines increases when moving the dialog to a monitor with higher zoom.

For example, a
PlainMessageDialogwith an according message looks like this when moved from 100% monitor to 150% monitor without this change:And it looks like this with the proposed change:
