Some applications don't forward WM_SIZE from DefWindowProc to the control, but instead only send a LB_SETCOLUMNWIDTH message, even when the column width doesn't change (but the listbox size does).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22440 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
v2: Don't call UpdateSize, just update the width & height, and also call UpdateScroll.
dlls/comctl32/listbox.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 252844e..2137ef8 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -1257,12 +1257,19 @@ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent ) /*********************************************************************** * LISTBOX_SetColumnWidth */ -static LRESULT LISTBOX_SetColumnWidth( LB_DESCR *descr, INT width) +static LRESULT LISTBOX_SetColumnWidth( LB_DESCR *descr, INT column_width) { - if (width == descr->column_width) return LB_OKAY; - TRACE("[%p]: new column width = %d\n", descr->self, width ); - descr->column_width = width; - LISTBOX_UpdatePage( descr ); + RECT rect; + + TRACE("[%p]: new column width = %d\n", descr->self, column_width); + + GetClientRect(descr->self, &rect); + descr->width = rect.right - rect.left; + descr->height = rect.bottom - rect.top; + descr->column_width = column_width; + + LISTBOX_UpdatePage(descr); + LISTBOX_UpdateScroll(descr); return LB_OKAY; }
Some applications don't forward WM_SIZE from DefWindowProc to the control, but instead only send a LB_SETCOLUMNWIDTH message, even when the column width doesn't change (but the listbox size does).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22440 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
v2: Don't call UpdateSize, just update the width & height, and also call UpdateScroll.
dlls/user32/listbox.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 05fcc44..c8bd148 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1262,12 +1262,19 @@ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent ) /*********************************************************************** * LISTBOX_SetColumnWidth */ -static LRESULT LISTBOX_SetColumnWidth( LB_DESCR *descr, INT width) +static LRESULT LISTBOX_SetColumnWidth( LB_DESCR *descr, INT column_width) { - if (width == descr->column_width) return LB_OKAY; - TRACE("[%p]: new column width = %d\n", descr->self, width ); - descr->column_width = width; - LISTBOX_UpdatePage( descr ); + RECT rect; + + TRACE("[%p]: new column width = %d\n", descr->self, column_width); + + GetClientRect(descr->self, &rect); + descr->width = rect.right - rect.left; + descr->height = rect.bottom - rect.top; + descr->column_width = column_width; + + LISTBOX_UpdatePage(descr); + LISTBOX_UpdateScroll(descr); return LB_OKAY; }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com