[PATCH 0/2] MR9664: win32u: Remove scrollbar rect offsets when WS_HSCROLL or WS_VSCROLL is present.
Fix RoomKey UI freezes. The extra 1 pixel offset causes the application to handle infinite WM_PAINT messages. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9664
From: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/user32/tests/scroll.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c index 77a34d0cff3..3bf6d8f6eba 100644 --- a/dlls/user32/tests/scroll.c +++ b/dlls/user32/tests/scroll.c @@ -219,6 +219,8 @@ static void test_ShowScrollBar(void) static void test_GetScrollBarInfo(void) { + int width, height, expected_width, expected_height; + LONG style; HWND hMainWnd; BOOL ret; SCROLLBARINFO sbi; @@ -278,6 +280,28 @@ static void test_GetScrollBarInfo(void) ok(EqualRect(&rect, &sbi.rcScrollBar), "PreviousRect %s != CurrentRect %s\n", wine_dbgstr_rect(&rect), wine_dbgstr_rect(&sbi.rcScrollBar)); + /* Test width when WS_VSCROLL is present */ + ok( GetWindowLongA( hMainWnd, GWL_STYLE ) & WS_VSCROLL , "Expected WS_VSCROLL.\n" ); + sbi.cbSize = sizeof(sbi); + ret = pGetScrollBarInfo( hMainWnd, OBJID_HSCROLL, &sbi ); + ok( ret, "The GetScrollBarInfo() call should not fail.\n" ); + width = sbi.rcScrollBar.right - sbi.rcScrollBar.left; + GetClientRect( hMainWnd, &rect ); + expected_width = rect.right - rect.left; + todo_wine + ok( width == expected_width, "Expected width %d, got %d.\n", expected_width, width ); + + /* Test height when WS_HSCROLL is present */ + ok( GetWindowLongA( hMainWnd, GWL_STYLE ) & WS_HSCROLL , "Expected WS_HSCROLL.\n" ); + sbi.cbSize = sizeof(sbi); + ret = pGetScrollBarInfo( hMainWnd, OBJID_VSCROLL, &sbi ); + ok( ret, "The GetScrollBarInfo() call should not fail.\n" ); + height = sbi.rcScrollBar.bottom - sbi.rcScrollBar.top; + GetClientRect( hMainWnd, &rect ); + expected_height = rect.bottom - rect.top; + todo_wine + ok( height == expected_height, "Expected height %d, got %d.\n", expected_height, height ); + DestroyWindow(hScroll); DestroyWindow(hMainWnd); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9664
From: Zhiyi Zhang <zzhang(a)codeweavers.com> Fix RoomKey UI freezes. The extra 1 pixel offset causes the application to handle infinite WM_PAINT messages. --- dlls/user32/tests/scroll.c | 2 -- dlls/win32u/scroll.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c index 3bf6d8f6eba..11178585c84 100644 --- a/dlls/user32/tests/scroll.c +++ b/dlls/user32/tests/scroll.c @@ -288,7 +288,6 @@ static void test_GetScrollBarInfo(void) width = sbi.rcScrollBar.right - sbi.rcScrollBar.left; GetClientRect( hMainWnd, &rect ); expected_width = rect.right - rect.left; - todo_wine ok( width == expected_width, "Expected width %d, got %d.\n", expected_width, width ); /* Test height when WS_HSCROLL is present */ @@ -299,7 +298,6 @@ static void test_GetScrollBarInfo(void) height = sbi.rcScrollBar.bottom - sbi.rcScrollBar.top; GetClientRect( hMainWnd, &rect ); expected_height = rect.bottom - rect.top; - todo_wine ok( height == expected_height, "Expected height %d, got %d.\n", expected_height, height ); DestroyWindow(hScroll); diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 8db26fc8aa6..719cd5bfc5e 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -199,7 +199,6 @@ static BOOL get_scroll_bar_rect( HWND hwnd, int bar, RECT *rect, int *arrow_size get_client_rect_rel( hwnd, COORDS_WINDOW, rect, get_thread_dpi() ); rect->top = rect->bottom; rect->bottom += get_system_metrics( SM_CYHSCROLL ); - if (win->dwStyle & WS_VSCROLL) rect->right++; vertical = FALSE; break; @@ -215,7 +214,6 @@ static BOOL get_scroll_bar_rect( HWND hwnd, int bar, RECT *rect, int *arrow_size rect->left = rect->right; rect->right += get_system_metrics( SM_CXVSCROLL ); } - if (win->dwStyle & WS_HSCROLL) rect->bottom++; vertical = TRUE; break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9664
participants (2)
-
Zhiyi Zhang -
Zhiyi Zhang (@zhiyi)