[PATCH 2/2] user32/listbox: Update the size in SetColumnWidth unconditionally
Nikolay Sivov
nsivov at codeweavers.com
Tue Aug 21 05:25:08 CDT 2018
On 08/20/2018 06:49 PM, Gabriel Ivăncescu wrote:
> 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;
> }
>
Hi, Gabriel.
Thanks for the patches. I think there's more problems with resizing,
that could affect how this one should be fixed. For example if
LBS_NOINTEGRALHEIGHT is not set it's possible to get last item partially
visible. On Windows initial window size is also adjusted to be a
multiple of item height, so setting column width does not have to resize
anything.
When control does not have WM_SIZE is integral height still enforced?
Could you look into that?
More information about the wine-devel
mailing list