[PATCH 2/2] user32/listbox: Update the size in SetColumnWidth unconditionally

Gabriel Iv─âncescu gabrielopcode at gmail.com
Mon Aug 20 10:49:42 CDT 2018


When the listbox receives a WM_WINDOWPOSCHANGED message and calls DefWindowProc on it, which then ends up sending a WM_SIZE to the window, some applications swallow that up and won't pass the WM_SIZE to the listbox. However, they do pass a LB_SETCOLUMNWIDTH, even when the column width did not change at all. So we have to unconditionally update the size itself (not just the page) when we receive that message.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22440
Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
---
 dlls/user32/listbox.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index 991ab87..fbed95c 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -1265,10 +1265,12 @@ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent )
  */
 static LRESULT LISTBOX_SetColumnWidth( LB_DESCR *descr, INT width)
 {
-    if (width == descr->column_width) return LB_OKAY;
-    TRACE("[%p]: new column width = %d\n", descr->self, width );
+    /* update the SIZE unconditionally, because some applications swallow
+       WM_SIZE from DefWindowProc and only send LB_SETCOLUMNWIDTH, even
+       when the column width doesn't even change (but its size does) */
+    TRACE("[%p]: new column width = %d\n", descr->self, width);
     descr->column_width = width;
-    LISTBOX_UpdatePage( descr );
+    LISTBOX_UpdateSize(descr);
     return LB_OKAY;
 }
 
-- 
1.9.1




More information about the wine-devel mailing list