Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

@HeikoKlare HeikoKlare commented Oct 28, 2025

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 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 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 such Dialogs 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 PlainMessageDialog with an according message looks like this when moved from 100% monitor to 150% monitor without this change:
image

And it looks like this with the proposed change:
image

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 23m 13s ⏱️ +30s
 8 234 tests ±0   7 985 ✅ ±0  249 💤 ±0  0 ❌ ±0 
23 622 runs  ±0  22 828 ✅ ±0  794 💤 ±0  0 ❌ ±0 

Results for commit 74614be. ± Comparison against base commit 68371cb.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare marked this pull request as ready for review October 29, 2025 07:18
@HeikoKlare HeikoKlare force-pushed the dialog-resize-zoomchange branch from 81f9a56 to ed54d07 Compare October 30, 2025 14:25
@HeikoKlare HeikoKlare changed the title Adapt size of Windows based on default size upon zoom change Adapt size of Dialogs based on default size upon zoom change Oct 30, 2025
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.
@HeikoKlare HeikoKlare force-pushed the dialog-resize-zoomchange branch from ed54d07 to 74614be Compare October 30, 2025 15:37
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.

(Some) Dialogs are smaller than expected

1 participant