From: Fabian Maurer Subject: [PATCH 2/2] user32: Make combobox redraw correctly when no scrollbars are needed Message-Id: <20171111205641.12655-2-dark.shadow4@web.de> Date: Sat, 11 Nov 2017 21:56:41 +0100 In-Reply-To: <20171111205641.12655-1-dark.shadow4@web.de> References: <20171111205641.12655-1-dark.shadow4@web.de> Some programs seem to be picky about the size they get in WM_NCCALCSIZE. When the scrollbar is visible at the wrong time, that messes up the calculation and leads to its display being permanently broken. Fix that by hiding the scrollbar when the height is 0 and sending a frame-changed notification when showing the dropdown list. Fixes Bug 43465. Signed-off-by: Fabian Maurer --- dlls/user32/combo.c | 2 +- dlls/user32/listbox.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c index c43d726205..2f270e5db5 100644 --- a/dlls/user32/combo.c +++ b/dlls/user32/combo.c @@ -1063,7 +1063,7 @@ static void CBDropDown( LPHEADCOMBO lphc ) } SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, r.left, r.top, r.right - r.left, r.bottom - r.top, - SWP_NOACTIVATE | SWP_SHOWWINDOW ); + SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_FRAMECHANGED ); if( !(lphc->wState & CBF_NOREDRAW) ) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 6b47f053ae..8f150ae74a 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -234,6 +234,11 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr ) the programmer use it for his/her own purposes. */ if (descr->style & LBS_NOREDRAW) return; + if (descr->height == 0) + { + ShowScrollBar(descr->self, SB_VERT, FALSE); + return; + } info.cbSize = sizeof(info); if (descr->style & LBS_MULTICOLUMN) -- 2.15.0