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

Gabriel Ivăncescu gabrielopcode at gmail.com
Mon Aug 20 10:49:41 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/comctl32/listbox.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index b3491bb..b3719a6 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -1260,10 +1260,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