From b2cb5e7f3b0629ae4f3ae1e25c431d6123b7d536 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Jan 2021 18:10:03 +0100 Subject: [PATCH] Fix wxChoice drop down height without visual theme in wxMSW When using pre-v6 comctl32.dll (e.g. by disabling the visual styles explicitly or by just not using the manifest), we need to update the drop down height manually, and for this we must ensure that overridden wxChoice::DoMoveWindow() is called from MSWUpdateDropDownHeight(). Closes #19026. --- src/msw/choice.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 1c6fff4a35..8f66f7877a 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -455,9 +455,18 @@ void wxChoice::MSWEndDeferWindowPos() void wxChoice::MSWUpdateDropDownHeight() { + int flags = wxSIZE_USE_EXISTING; + if ( wxApp::GetComCtl32Version() < 600 ) + { + // Make sure our DoMoveWindow() will get called to update the dropdown + // height, this happens automatically with comctl32.dll v6, but not + // with earlier versions. + flags |= wxSIZE_FORCE; + } + // be careful to not change the width here DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, GetSize().y, - wxSIZE_USE_EXISTING); + flags); } void wxChoice::DoMoveWindow(int x, int y, int width, int height)