From 2fa0bd5b1bb95211960c5139d3d320004725ba58 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 26 Jun 2022 22:17:15 +0200 Subject: [PATCH] Improve documentation of the default wxEVT_DPI_CHANGED handler Mention that the size may grow unexpectedly. Co-Authored-By: Maarten Bent --- interface/wx/event.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/interface/wx/event.h b/interface/wx/event.h index 6a82c8ba00..06b929292c 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -3432,11 +3432,12 @@ public: their appearance when the DPI changes. However the default handler for the top level window itself only sets the new window size, by scaling the current size by the DPI ratio -- e.g. doubling it if the DPI has changed - from normal to "high", i.e. 200%, one. If your application prefers to use - some other logic than simply scaling the existing size, you should call - wxWindow::SetSize() in your handler of this event for the top level window - and @e not call @c event.Skip() to prevent the default handler from - resizing the window. + from normal to "high", i.e. 200%, one -- and also ensuring that the window + is still bigger than its best size, as returned by wxWindow::GetBestSize(). + Note that in some cases this may cause the window size to grow unexpectedly + and you may prefer to call wxWindow::SetSize() in your handler of this + event for the top level window and @e not call @c event.Skip() to prevent + the default handler from resizing the window. Currently this event is generated by wxMSW port if only and only if the MSW application runs under Windows 10 Creators Update (v1703) or later and