[PATCH 0/1] MR11481: comctl32_v6: Improve LM_GETIDEALSIZE on a zero sized control.
From: Bernhard Übelacker <bernhardu@mailbox.org> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59944 --- dlls/comctl32/tests/syslink.c | 2 ++ dlls/comctl32_v6/syslink.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 71b87e7b6b5..2eb43fcaa3f 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -320,6 +320,7 @@ static void test_LM_GETIDEALSIZE(void) hwnd = create_syslink(WS_CHILD | WS_TABSTOP | WS_VISIBLE, hWndParent); ok(hwnd != NULL, "Failed to create SysLink window.\n"); + ok(MoveWindow(hwnd, 0, 0, 0, 0, FALSE), "MoveWindow failed.\n"); memset(&sz, 0, sizeof(sz)); ret = SendMessageA(hwnd, LM_GETIDEALSIZE, 0, (LPARAM)&sz); @@ -330,6 +331,7 @@ static void test_LM_GETIDEALSIZE(void) { ok(sz.cx > 5, "Unexpected ideal width, %ld.\n", sz.cx); ok(sz.cy == ret, "Unexpected ideal height, %ld.\n", sz.cy); + ok(sz.cx > sz.cy, "Expected sz.cx > sz.cy (%ld > %ld).\n", sz.cx, sz.cy); } DestroyWindow(hwnd); diff --git a/dlls/comctl32_v6/syslink.c b/dlls/comctl32_v6/syslink.c index ecf9b242704..36f7edfca38 100644 --- a/dlls/comctl32_v6/syslink.c +++ b/dlls/comctl32_v6/syslink.c @@ -1167,9 +1167,9 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect) rc.right -= SL_RIGHTMARGIN; rc.bottom -= SL_BOTTOMMARGIN; - if(rc.right - SL_LEFTMARGIN < 0) + if(rc.right - SL_LEFTMARGIN <= 0) rc.right = MAXLONG; - if (rc.bottom - SL_TOPMARGIN < 0) + if (rc.bottom - SL_TOPMARGIN <= 0) rc.bottom = MAXLONG; hOldFont = SelectObject(hdc, infoPtr->Font); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11481
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/tests/syslink.c:
{ ok(sz.cx > 5, "Unexpected ideal width, %ld.\n", sz.cx); ok(sz.cy == ret, "Unexpected ideal height, %ld.\n", sz.cy); + ok(sz.cx > sz.cy, "Expected sz.cx > sz.cy (%ld > %ld).\n", sz.cx, sz.cy); }
Let's move the `MoveWindow(hwnd, 0, 0, 0, 0, FALSE)` here and check the size from LM_GETIDEALSIZE again. That would avoid changing the existing test for a control with a non-zero size. And let's add the test with a todo_wine first. Then remove the todo_wine in the second patch that fixes the bug. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11481#note_147794
participants (3)
-
Bernhard Übelacker -
Bernhard Übelacker (@bernhardu) -
Zhiyi Zhang (@zhiyi)