Fixes for behaviour after DPI change in wxMSW (PR #26604)

43 views
Skip to first unread message

VZ

unread,
Jun 16, 2026, 2:22:00 PM (8 days ago) Jun 16
to wx-...@googlegroups.com, Subscribed

See #26557.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26604

Commit Summary

  • 8386a98 Restrict the new size after DPI change to the display size
  • 75284bb Ensure the window origin is visible after DPI change
  • 863e46b Limit maximum height of wxTreeCtrl best size

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604@github.com>

VZ

unread,
Jun 19, 2026, 9:04:05 PM (4 days ago) Jun 19
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26604)

I'm going to merge this soon if there are no objections/comments from @taler21 or anybody else because this does improve things, even if it doesn't solve all the problems.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/c4755788975@github.com>

VZ

unread,
Jun 20, 2026, 9:52:58 AM (4 days ago) Jun 20
to wx-...@googlegroups.com, Push

@vadz pushed 3 commits.

  • 2da4ea9 Move code for updating sizers on DPI change to wxSizer itself
  • 3a1bcdd Update wxSizer own min size on DPI change
  • 0245dea Update wxGridSizer gap sizes on DPI change


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/before/863e46bb5345f4b97772bd04bf49c345152d9d91/after/0245dea95135c0264af54c2b56deff10218c6e22@github.com>

VZ

unread,
Jun 20, 2026, 11:02:26 AM (4 days ago) Jun 20
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 81ac052 Always set both components of pane sizer item min size


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/before/0245dea95135c0264af54c2b56deff10218c6e22/after/81ac052c6ecac6f4041fa5313be0754d62a6d329@github.com>

taler21

unread,
Jun 22, 2026, 8:05:45 AM (2 days ago) Jun 22
to wx-...@googlegroups.com, Subscribed
taler21 left a comment (wxWidgets/wxWidgets#26604)

This PR significantly improves things. Many thanks!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/c4768068602@github.com>

VZ

unread,
Jun 22, 2026, 8:29:37 AM (2 days ago) Jun 22
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26604)

Thanks for testing!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/c4768283388@github.com>

VZ

unread,
Jun 22, 2026, 8:44:45 AM (2 days ago) Jun 22
to wx-...@googlegroups.com, Subscribed

Merged #26604 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/issue_event/27041529933@github.com>

taler21

unread,
Jun 23, 2026, 7:58:16 AM (18 hours ago) Jun 23
to wx-...@googlegroups.com, Subscribed
taler21 left a comment (wxWidgets/wxWidgets#26604)

Unfortunately, commit 8386a98 (Restrict the new size after DPI change to the display size, 2026-06-16) introduced a regression for non-resizable dialogs.
After changing the DPI, the dialog buttons are no longer visible because the dialog becomes too small.

This can also be seen in the dialogs sample, for instance with the 'Credentials dialog', which can be opend by pressing Ctrl+Shift+C.
After changing the DPI scaling from 200% to 100%, the dialog becomes too small.
CredentialEntryDialog-after-DPI-change.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/c4778931250@github.com>

VZ

unread,
Jun 23, 2026, 1:27:58 PM (13 hours ago) Jun 23
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26604)

Oops, thanks for noticing and sorry for a stupid mistake: I don't know why, but I've switched from window to client size in this code and we shouldn't do this, of course.

This should fix it and I'll push it soon:

diff --git a/src/msw/nonownedwnd.cpp b/src/msw/nonownedwnd.cpp
index c08e6f8358..635858876e 100644
--- a/src/msw/nonownedwnd.cpp
+++ b/src/msw/nonownedwnd.cpp
@@ -319,7 +319,7 @@ bool wxNonOwnedWindow::HandleDPIChange(const wxSize& newDPI, const wxRect& newRe
         wxRect actualNewRect = newRect;
         if ( wxSizer* sizer = GetSizer() )
         {
-            const wxSize minSize = sizer->ComputeFittingClientSize(this);
+            const wxSize minSize = sizer->ComputeFittingWindowSize(this);
             wxSize diff = minSize - newRect.GetSize();
 
             // We don't want to shrink the window as if the user had increased


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26604/c4781778095@github.com>

Reply all
Reply to author
Forward
0 new messages