From 5bb6046ca90eb282ad8a8527b4e6153f8c9a9490 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 17 Oct 2021 18:29:48 +0100 Subject: [PATCH] Document remaining problems when changing DPI of wxMSW toolbar Unfortunately even using CallAfter() doesn't allow to completely repair the toolbar display after moving it to a display with a different fractional scaling, e.g. from 125% to 175%. There are still some minor but visible display artefacts in this case that we can't get rid of even by resizing the window containing the toolbar programmatically -- even though doing it interactively does help. --- src/msw/toolbar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index fe7b8f49d2..b9d38736c8 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1991,7 +1991,10 @@ void wxToolBar::OnDPIChanged(wxDPIChangedEvent& event) // work. E.g. when switching from 125% to 150%. All the sizes are set // correctly, but after all dpi events are handled, 5px of the toolbar are // gone and a dark-gray bar appears. After resizing the window, the gray - // bar disapears as well. + // bar disappears as well, but unfortunately calling PostSizeEventToParent() + // either from here or even from RealizeHelper() itself doesn't work and + // there are still minor but visible cosmetic problems when moving the + // toolbar from 125% to 175% display. CallAfter(&wxToolBar::RealizeHelper); }