wxAuiToolbar has incorrect behavior when moved to a monitor with a different DPI (Issue #23411)

34 views
Skip to first unread message

Kumazuma

unread,
Apr 1, 2023, 3:39:59 AM4/1/23
to wx-...@googlegroups.com, Subscribed

Description

To Reproduce:

  1. run AuiDemo on 150% DPI monitor
  2. move to 100% DPI monitor

Platform and version information

  • wxWidgets version you use: master
  • wxWidgets port you use: wxMSW
  • OS and its version: Win10 22h2, Win11 22h2
  • GTK version:
  • Which GDK backend is used:
  • Current theme:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23411@github.com>

VZ

unread,
Apr 1, 2023, 6:15:25 PM4/1/23
to wx-...@googlegroups.com, Subscribed

Just to be clear, is the problem ("incorrect behaviour") you're seeing the margins of the toolbar tools which become too big if the sample is started on a high DPI screen and then moved to a normal DPI one or is there something else that I'm missing?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23411/1493140868@github.com>

VZ

unread,
Apr 1, 2023, 7:56:00 PM4/1/23
to wx-...@googlegroups.com, Subscribed

At least one problem here is that we never update wxAuiGenericToolBarArt::m_separatorSize and other element sizes on DPI change. The confusing thing is that this normally shouldn't be needed if you trust the comments here:

https://github.com/wxWidgets/wxWidgets/blob/2c0f6a2aa0c8d0650d1f856aa279ce7495925c17/include/wx/aui/auibar.h#L341-L344

and here:

https://github.com/wxWidgets/wxWidgets/blob/2c0f6a2aa0c8d0650d1f856aa279ce7495925c17/include/wx/aui/auibar.h#L456-L460

but it seems like these comments (added in 9e8352b) are just wrong and these values are in the usual logical pixels, as they're initialized with FromDIP() (this was done in 770e0bc i.e. a much longer time ago) and used without FromDIP() (which is the case since acd7ea6).

So I think we need to remove the wrong comments and recompute all these values on DPI change.

But, in principle, it would also be possible to change the code to match the comments and then we wouldn't need to recompute anything. However it would be inconsistent with mostly everything else, so I don't see any real reason to do it like this -- but I could be missing something because I had to have something in mind when writing these comments...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23411/1493174456@github.com>

VZ

unread,
Apr 1, 2023, 8:04:02 PM4/1/23
to wx-...@googlegroups.com, Subscribed

... oh wait, I know what I had in mind: those values need to be in DIPs because wxAuiToolBarArt can be used with multiple windows, potentially using different DPIs as they could be on different displays. So I totally take the comment above back, we really need to make the code correspond to the comments.

But, also, fixing this is not enough: there are also tool packing, border and margins in wxAuiToolBar itself which are expressed in normal (logical) pixels, but need to be recomputed on DPI change. I'm going to try to do this soon.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23411/1493177055@github.com>

VZ

unread,
Apr 4, 2023, 4:31:13 PM4/4/23
to wx-...@googlegroups.com, Subscribed

I don't understand what's going on here, even after updating the metrics on DPI change, layout is still wrong after changing DPI, somehow all the toolbars keep their old size which is too big if the DPI scaling decreases.

I've also noticed another problem, not related to toolbars: the title bars are not laid out/drawn correctly after a DPI change, see e.g. "Tree Pane" in the sample.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23411/1496567063@github.com>

VZ

unread,
Jun 1, 2026, 3:09:59 PM (2 days ago) Jun 1
to wx-...@googlegroups.com, Subscribed

Closed #23411 as completed.


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/issue/23411/issue_event/26203013668@github.com>

VZ

unread,
Jun 1, 2026, 3:09:59 PM (2 days ago) Jun 1
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#23411)

This should be fixed by #26546, please test.

It also seems roughly the same as #26075, so I'll close this one as duplicate even if it's earlier because the other issue contains more details.


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/issues/23411/4595660951@github.com>

Reply all
Reply to author
Forward
0 new messages