[PATCH 2/2] user32: Make combobox redraw correctly when no scrollbars are needed

Fabian Maurer dark.shadow4 at web.de
Mon Feb 5 16:36:46 CST 2018


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 <dark.shadow4 at web.de>
---
 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




More information about the wine-devel mailing list