Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 12 ++++++++++++ dlls/user32/winpos.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 50dbf49e19..ceb4b82313 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6548,6 +6548,18 @@ static void test_ShowWindow(void) wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); + /* SetWindowPos shouldn't affect the client rect */ + ret = SetWindowPos(hwnd, 0, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "not expected ret: %lu\n", ret); + GetWindowRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 4b39d0aa39..38444b243f 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1699,7 +1699,7 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS *pWinpos, RECT *old_window_rect, REC
WIN_GetRectangles( pWinpos->hwnd, COORDS_PARENT, old_window_rect, old_client_rect ); *new_window_rect = *old_window_rect; - *new_client_rect = (wndPtr->dwStyle & WS_MINIMIZE) ? *old_window_rect : *old_client_rect; + *new_client_rect = *old_client_rect;
if (!(pWinpos->flags & SWP_NOSIZE)) {
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/nonclient.c | 5 +++++ dlls/user32/tests/win.c | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 4444a2c91e..26bb0a01b5 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -414,6 +414,11 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect ) if (winRect->left > winRect->right) winRect->right = winRect->left; } + else + { + winRect->right = winRect->left; + winRect->bottom = winRect->top; + } return result; }
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index ceb4b82313..308e243c3d 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6469,7 +6469,7 @@ static void test_ShowWindow(void) { HWND hwnd; DWORD style; - RECT rcMain, rc, rcMinimized, rcClient, rcEmpty, rcMaximized, rcResized; + RECT rcMain, rc, rcMinimized, rcClient, rcEmpty, rcMaximized, rcResized, rcNonClient; LPARAM ret; MONITORINFO mon_info;
@@ -6533,7 +6533,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); /* shouldn't be able to resize minimized windows */ @@ -6547,7 +6546,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); /* SetWindowPos shouldn't affect the client rect */ @@ -6559,9 +6557,14 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); + /* test NC area */ + GetWindowRect(hwnd, &rc); + SetRect(&rcNonClient, rc.left, rc.top, rc.left, rc.top); + DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc); + ok(EqualRect(&rc, &rcNonClient), "expected %s, got %s\n", + wine_dbgstr_rect(&rcNonClient), wine_dbgstr_rect(&rc));
ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); @@ -6651,7 +6654,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
@@ -6667,7 +6669,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
@@ -6710,7 +6711,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd); @@ -6729,7 +6729,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd); @@ -6740,7 +6739,7 @@ static void test_ShowWindow(void) static void test_ShowWindow_owned(HWND hwndMain) { MONITORINFO mon_info = {sizeof(mon_info)}; - RECT rect, orig, expect; + RECT rect, orig, expect, nc; BOOL ret; HWND hwnd, hwnd2; LONG style; @@ -6798,6 +6797,12 @@ static void test_ShowWindow_owned(HWND hwndMain) todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* test NC area */ + GetWindowRect(hwnd, &rect); + SetRect(&nc, rect.left, rect.top, rect.left, rect.top); + DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect); + ok(EqualRect(&rect, &nc), "expected %s, got %s\n", + wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
/* multiple minimized owned windows stack next to each other (and eventually * on top of each other) */ @@ -6863,7 +6868,7 @@ static void test_ShowWindow_owned(HWND hwndMain)
static void test_ShowWindow_child(HWND hwndMain) { - RECT rect, orig, expect; + RECT rect, orig, expect, nc; BOOL ret; HWND hwnd, hwnd2; LONG style; @@ -6926,6 +6931,12 @@ static void test_ShowWindow_child(HWND hwndMain) todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* test NC area */ + GetWindowRect(hwnd, &rect); + SetRect(&nc, rect.left, rect.top, rect.left, rect.top); + DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect); + ok(EqualRect(&rect, &nc), "expected %s, got %s\n", + wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
/* multiple minimized children also stack; here the parent is too small to * fit more than one per row */ @@ -6993,7 +7004,7 @@ static void test_ShowWindow_child(HWND hwndMain)
static void test_ShowWindow_mdichild(HWND hwndMain) { - RECT rect, orig, expect; + RECT rect, orig, expect, nc; BOOL ret; HWND mdiclient, hwnd, hwnd2; LONG style; @@ -7051,6 +7062,12 @@ static void test_ShowWindow_mdichild(HWND hwndMain) todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); + /* test NC area */ + GetWindowRect(hwnd, &rect); + SetRect(&nc, rect.left, rect.top, rect.left, rect.top); + DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rect); + ok(EqualRect(&rect, &nc), "expected %s, got %s\n", + wine_dbgstr_rect(&nc), wine_dbgstr_rect(&rect));
/* multiple minimized children also stack; here the parent is too small to * fit more than one per row */
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47894
Your paranoid android.
=== debian9 (32 bit WoW report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
=== debian9 (64 bit WoW report) ===
user32: win.c:9883: Test failed: GetForegroundWindow() = 0xd00050
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 6 ------ dlls/user32/winpos.c | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 308e243c3d..8111ec0e5e 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6529,7 +6529,6 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6542,7 +6541,6 @@ static void test_ShowWindow(void) SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "not expected ret: %lu\n", ret); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6553,7 +6551,6 @@ static void test_ShowWindow(void) SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "not expected ret: %lu\n", ret); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6650,7 +6647,6 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6665,7 +6661,6 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6725,7 +6720,6 @@ static void test_ShowWindow(void) style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_MINIMIZE, "window should be minimized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 38444b243f..bca50ca12a 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -975,8 +975,8 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) wpl.ptMinPosition = WINPOS_FindIconPos( hwnd, wpl.ptMinPosition );
SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y, - wpl.ptMinPosition.x + GetSystemMetrics(SM_CXICON), - wpl.ptMinPosition.y + GetSystemMetrics(SM_CYICON) ); + wpl.ptMinPosition.x + GetSystemMetrics(SM_CXMINIMIZED), + wpl.ptMinPosition.y + GetSystemMetrics(SM_CYMINIMIZED) ); return SWP_NOSIZE | SWP_NOMOVE; } if (!SendMessageW( hwnd, WM_QUERYOPEN, 0, 0 )) return SWP_NOSIZE | SWP_NOMOVE; @@ -1006,8 +1006,8 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
if (!(old_style & WS_MINIMIZE)) swpFlags |= SWP_STATECHANGED; SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y, - wpl.ptMinPosition.x + GetSystemMetrics(SM_CXICON), - wpl.ptMinPosition.y + GetSystemMetrics(SM_CYICON) ); + wpl.ptMinPosition.x + GetSystemMetrics(SM_CXMINIMIZED), + wpl.ptMinPosition.y + GetSystemMetrics(SM_CYMINIMIZED) ); swpFlags |= SWP_NOCOPYBITS; break;
@@ -1705,8 +1705,8 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS *pWinpos, RECT *old_window_rect, REC { if (wndPtr->dwStyle & WS_MINIMIZE) { - new_window_rect->right = new_window_rect->left + GetSystemMetrics(SM_CXICON); - new_window_rect->bottom = new_window_rect->top + GetSystemMetrics(SM_CYICON); + new_window_rect->right = new_window_rect->left + GetSystemMetrics(SM_CXMINIMIZED); + new_window_rect->bottom = new_window_rect->top + GetSystemMetrics(SM_CYMINIMIZED); } else {
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47895
Your paranoid android.
=== debian9 (32 bit Japanese:Japan report) ===
user32: win.c:9913: Test failed: Expected foreground window 0x20052, got 0xc400ce
=== debian9 (32 bit Chinese:China report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
=== debian9 (64 bit WoW report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/nonclient.c | 4 ---- dlls/user32/tests/win.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 26bb0a01b5..0dea3a2376 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -315,8 +315,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL { NONCLIENTMETRICSW ncm;
- if (style & WS_MINIMIZE) return TRUE; - TRACE("(%s) %08x %d %08x\n", wine_dbgstr_rect(rect), style, menu, exStyle );
ncm.cbSize = sizeof(ncm); @@ -335,8 +333,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectExForDpi( LPRECT rect, DWORD style { NONCLIENTMETRICSW ncm;
- if (style & WS_MINIMIZE) return TRUE; - TRACE("(%s) %08x %d %08x %u\n", wine_dbgstr_rect(rect), style, menu, exStyle, dpi );
ncm.cbSize = sizeof(ncm); diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 8111ec0e5e..9540496fb7 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -5342,7 +5342,7 @@ static void test_AWR_window_size(BOOL menu)
static void test_AWR_flags(void) { - static const DWORD styles[] = { WS_POPUP, WS_BORDER, WS_DLGFRAME, WS_THICKFRAME }; + static const DWORD styles[] = { WS_POPUP, WS_BORDER, WS_DLGFRAME, WS_THICKFRAME, WS_MINIMIZE }; static const DWORD exStyles[] = { WS_EX_CLIENTEDGE, WS_EX_TOOLWINDOW, WS_EX_WINDOWEDGE, WS_EX_APPWINDOW, WS_EX_DLGMODALFRAME, WS_EX_STATICEDGE };
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 8 ---- dlls/user32/winpos.c | 103 ++++++++++++++++++++++++++++++---------- 2 files changed, 77 insertions(+), 34 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 9540496fb7..5f101b38c5 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -11386,7 +11386,6 @@ static void test_arrange_iconic_windows(void)
SetLastError(0xdeadbeef); ret = ArrangeIconicWindows(parent); -todo_wine ok(!ret, "wrong ret %u\n", ret); ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
@@ -11400,7 +11399,6 @@ todo_wine
SetLastError(0xdeadbeef); ret = ArrangeIconicWindows(parent); -todo_wine ok(!ret, "wrong ret %u\n", ret); ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
@@ -11423,14 +11421,12 @@ todo_wine }
ret = ArrangeIconicWindows(parent); -todo_wine ok(ret == 1, "wrong ret %u\n", ret);
GetWindowRect(hwnds[0], &rect); SetRect(&expect, 0, 0, GetSystemMetrics(SM_CXMINIMIZED), GetSystemMetrics(SM_CYMINIMIZED)); OffsetRect(&expect, mm.iHorzGap, mm.iVertGap); OffsetRect(&expect, pt.x, pt.y); -todo_wine ok(EqualRect(&rect, &expect), "expected rect %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -11452,7 +11448,6 @@ todo_wine }
ret = ArrangeIconicWindows(parent); -todo_wine ok(ret == 10, "wrong ret %u\n", ret);
col = mm.iHorzGap; @@ -11469,7 +11464,6 @@ todo_wine SetRect(&expect, col, row, col + GetSystemMetrics(SM_CXMINIMIZED), row + GetSystemMetrics(SM_CYMINIMIZED)); OffsetRect(&expect, pt.x, pt.y); -todo_wine ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i, wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -11489,7 +11483,6 @@ todo_wine }
ret = ArrangeIconicWindows(parent); -todo_wine ok(ret == 10, "wrong ret %u\n", ret);
col = parent_rect.right - mm.iHorzGap; @@ -11506,7 +11499,6 @@ todo_wine SetRect(&expect, col - GetSystemMetrics(SM_CXMINIMIZED), row - GetSystemMetrics(SM_CYMINIMIZED), col, row); OffsetRect(&expect, pt.x, pt.y); -todo_wine ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i, wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index bca50ca12a..6d137d75d7 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -852,6 +852,75 @@ MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd ) return MinMax; }
+static POINT get_first_minimized_child_pos( const RECT *parent, const MINIMIZEDMETRICS *mm, + int width, int height ) +{ + POINT ret; + + if (mm->iArrange & ARW_STARTRIGHT) + ret.x = parent->right - mm->iHorzGap - width; + else + ret.x = parent->left + mm->iHorzGap; + if (mm->iArrange & ARW_STARTTOP) + ret.y = parent->top + mm->iVertGap; + else + ret.y = parent->bottom - mm->iVertGap - height; + + return ret; +} + +static void get_next_minimized_child_pos( const RECT *parent, const MINIMIZEDMETRICS *mm, + int width, int height, POINT *pos ) +{ + BOOL next; + + if (mm->iArrange & ARW_UP) /* == ARW_DOWN */ + { + if (mm->iArrange & ARW_STARTTOP) + { + pos->y += height + mm->iVertGap; + if ((next = pos->y + height > parent->bottom)) + pos->y = parent->top + mm->iVertGap; + } + else + { + pos->y -= height + mm->iVertGap; + if ((next = pos->y < parent->top)) + pos->y = parent->bottom - mm->iVertGap - height; + } + + if (next) + { + if (mm->iArrange & ARW_STARTRIGHT) + pos->x -= width + mm->iHorzGap; + else + pos->x += width + mm->iHorzGap; + } + } + else + { + if (mm->iArrange & ARW_STARTRIGHT) + { + pos->x -= width + mm->iHorzGap; + if ((next = pos->x < parent->left)) + pos->x = parent->right - mm->iHorzGap - width; + } + else + { + pos->x += width + mm->iHorzGap; + if ((next = pos->x + width > parent->right)) + pos->x = parent->left + mm->iHorzGap; + } + + if (next) + { + if (mm->iArrange & ARW_STARTTOP) + pos->y += height + mm->iVertGap; + else + pos->y -= height + mm->iVertGap; + } + } +}
/*********************************************************************** * WINPOS_FindIconPos @@ -2567,14 +2636,16 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp ) */ UINT WINAPI ArrangeIconicWindows( HWND parent ) { + int width, height, count = 0; RECT rectParent; HWND hwndChild; - INT x, y, xspacing, yspacing; POINT pt; MINIMIZEDMETRICS metrics;
metrics.cbSize = sizeof(metrics); SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(metrics), &metrics, 0 ); + width = GetSystemMetrics( SM_CXMINIMIZED ); + height = GetSystemMetrics( SM_CYMINIMIZED );
if (parent == GetDesktopWindow()) { @@ -2587,41 +2658,21 @@ UINT WINAPI ArrangeIconicWindows( HWND parent ) } else GetClientRect( parent, &rectParent );
- x = y = 0; - xspacing = GetSystemMetrics(SM_CXICONSPACING); - yspacing = GetSystemMetrics(SM_CYICONSPACING); + pt = get_first_minimized_child_pos( &rectParent, &metrics, width, height );
hwndChild = GetWindow( parent, GW_CHILD ); while (hwndChild) { if( IsIconic( hwndChild ) ) { - WINPOS_ShowIconTitle( hwndChild, FALSE ); - - if (metrics.iArrange & ARW_STARTRIGHT) - pt.x = rectParent.right - (x + 1) * xspacing; - else - pt.x = rectParent.left + x * xspacing; - if (metrics.iArrange & ARW_STARTTOP) - pt.y = rectParent.top + y * yspacing; - else - pt.y = rectParent.bottom - (y + 1) * yspacing; - - SetWindowPos( hwndChild, 0, pt.x + (xspacing - GetSystemMetrics(SM_CXICON)) / 2, - pt.y + (yspacing - GetSystemMetrics(SM_CYICON)) / 2, 0, 0, + SetWindowPos( hwndChild, 0, pt.x, pt.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); - if( IsWindow(hwndChild) ) - WINPOS_ShowIconTitle(hwndChild , TRUE ); - - if (++x >= (rectParent.right - rectParent.left) / xspacing) - { - x = 0; - y++; - } + get_next_minimized_child_pos( &rectParent, &metrics, width, height, &pt ); + count++; } hwndChild = GetWindow( hwndChild, GW_HWNDNEXT ); } - return yspacing; + return count; }
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47897
Your paranoid android.
=== debian9 (64 bit WoW report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 6 ---- dlls/user32/winpos.c | 68 ++++++++++++----------------------------- 2 files changed, 19 insertions(+), 55 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 5f101b38c5..3444abaf96 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6915,14 +6915,12 @@ static void test_ShowWindow_child(HWND hwndMain) SetRect(&expect, 0, expect.bottom - GetSystemMetrics(SM_CYMINIMIZED), GetSystemMetrics(SM_CXMINIMIZED), expect.bottom); OffsetRect(&expect, pt.x, pt.y); - todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); /* shouldn't be able to resize minimized windows */ ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "wrong ret %d\n", ret); GetWindowRect(hwnd, &rect); - todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); /* test NC area */ @@ -6943,7 +6941,6 @@ static void test_ShowWindow_child(HWND hwndMain) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd2, &rect); - todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
@@ -7046,14 +7043,12 @@ static void test_ShowWindow_mdichild(HWND hwndMain) SetRect(&expect, 0, expect.bottom - GetSystemMetrics(SM_CYMINIMIZED), GetSystemMetrics(SM_CXMINIMIZED), expect.bottom); OffsetRect(&expect, pt.x, pt.y); - todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); /* shouldn't be able to resize minimized windows */ ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "wrong ret %d\n", ret); GetWindowRect(hwnd, &rect); - todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect)); /* test NC area */ @@ -7074,7 +7069,6 @@ static void test_ShowWindow_mdichild(HWND hwndMain) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd2, &rect); - todo_wine ok(EqualRect(&expect, &rect), "expected %s, got %s\n", wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 6d137d75d7..4a28a6fbab 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -922,21 +922,13 @@ static void get_next_minimized_child_pos( const RECT *parent, const MINIMIZEDMET } }
-/*********************************************************************** - * WINPOS_FindIconPos - * - * Find a suitable place for an iconic window. - */ -static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt ) +static POINT get_minimized_pos( HWND hwnd, POINT pt ) { RECT rect, rectParent; HWND parent, child; HRGN hrgn, tmp; - int x, y, xspacing, yspacing; MINIMIZEDMETRICS metrics; - - metrics.cbSize = sizeof(metrics); - SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(metrics), &metrics, 0 ); + int width, height;
parent = GetAncestor( hwnd, GA_PARENT ); if (parent == GetDesktopWindow()) @@ -950,12 +942,15 @@ static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt ) } else GetClientRect( parent, &rectParent );
- if ((pt.x >= rectParent.left) && (pt.x + GetSystemMetrics(SM_CXICON) < rectParent.right) && - (pt.y >= rectParent.top) && (pt.y + GetSystemMetrics(SM_CYICON) < rectParent.bottom)) + if ((pt.x >= rectParent.left) && (pt.x + GetSystemMetrics( SM_CXMINIMIZED ) < rectParent.right) && + (pt.y >= rectParent.top) && (pt.y + GetSystemMetrics( SM_CYMINIMIZED ) < rectParent.bottom)) return pt; /* The icon already has a suitable position */
- xspacing = GetSystemMetrics(SM_CXICONSPACING); - yspacing = GetSystemMetrics(SM_CYICONSPACING); + width = GetSystemMetrics( SM_CXMINIMIZED ); + height = GetSystemMetrics( SM_CYMINIMIZED ); + + metrics.cbSize = sizeof(metrics); + SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(metrics), &metrics, 0 );
/* Check if another icon already occupies this spot */ /* FIXME: this is completely inefficient */ @@ -975,42 +970,17 @@ static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt ) } DeleteObject( tmp );
- for (y = 0; y < (rectParent.bottom - rectParent.top) / yspacing; y++) + pt = get_first_minimized_child_pos( &rectParent, &metrics, width, height ); + for (;;) { - if (metrics.iArrange & ARW_STARTTOP) - { - rect.top = rectParent.top + y * yspacing; - rect.bottom = rect.top + yspacing; - } - else - { - rect.bottom = rectParent.bottom - y * yspacing; - rect.top = rect.bottom - yspacing; - } - for (x = 0; x < (rectParent.right - rectParent.left) / xspacing; x++) - { - if (metrics.iArrange & ARW_STARTRIGHT) - { - rect.right = rectParent.right - x * xspacing; - rect.left = rect.right - xspacing; - } - else - { - rect.left = rectParent.left + x * xspacing; - rect.right = rect.left + xspacing; - } - if (!RectInRegion( hrgn, &rect )) - { - /* No window was found, so it's OK for us */ - pt.x = rect.left + (xspacing - GetSystemMetrics(SM_CXICON)) / 2; - pt.y = rect.top + (yspacing - GetSystemMetrics(SM_CYICON)) / 2; - DeleteObject( hrgn ); - return pt; - } - } + SetRect( &rect, pt.x, pt.y, pt.x + width, pt.y + height ); + if (!RectInRegion( hrgn, &rect )) + break; + + get_next_minimized_child_pos( &rectParent, &metrics, width, height, &pt ); } + DeleteObject( hrgn ); - pt.x = pt.y = 0; return pt; }
@@ -1041,7 +1011,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) case SW_SHOWMINIMIZED: case SW_FORCEMINIMIZE: case SW_MINIMIZE: - wpl.ptMinPosition = WINPOS_FindIconPos( hwnd, wpl.ptMinPosition ); + wpl.ptMinPosition = get_minimized_pos( hwnd, wpl.ptMinPosition );
SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y, wpl.ptMinPosition.x + GetSystemMetrics(SM_CXMINIMIZED), @@ -1071,7 +1041,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
old_style = WIN_SetStyle( hwnd, WS_MINIMIZE, WS_MAXIMIZE );
- wpl.ptMinPosition = WINPOS_FindIconPos( hwnd, wpl.ptMinPosition ); + wpl.ptMinPosition = get_minimized_pos( hwnd, wpl.ptMinPosition );
if (!(old_style & WS_MINIMIZE)) swpFlags |= SWP_STATECHANGED; SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y,
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47898
Your paranoid android.
=== debian9 (32 bit WoW report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/nonclient.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 0dea3a2376..0e15e954fa 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -430,8 +430,6 @@ static void NC_GetInsideRect( HWND hwnd, enum coords_relative relative, RECT *re { WIN_GetRectangles( hwnd, relative, rect, NULL );
- if (style & WS_MINIMIZE) return; - /* Remove frame from rectangle */ if (HAS_THICKFRAME( style, ex_style )) { @@ -955,9 +953,6 @@ static void NC_DoNCPaint( HWND hwnd, HRGN clip ) flags = wndPtr->flags; WIN_ReleasePtr( wndPtr );
- if ( dwStyle & WS_MINIMIZE || - !WIN_IsWindowDrawable( hwnd, 0 )) return; /* Nothing to do */ - active = flags & WIN_NCACTIVATED;
TRACE("%p %d\n", hwnd, active ); @@ -1065,10 +1060,7 @@ LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip)
if( dwStyle & WS_VISIBLE ) { - if( dwStyle & WS_MINIMIZE ) - WINPOS_RedrawIconTitle( hwnd ); - else - NC_DoNCPaint( hwnd, clip ); + NC_DoNCPaint( hwnd, clip );
if (parent == GetDesktopWindow()) PostMessageW( parent, WM_PARENTNOTIFY, WM_NCPAINT, (LPARAM)hwnd ); @@ -1097,10 +1089,7 @@ LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) */ if (lParam != -1) { - if (IsIconic(hwnd)) - WINPOS_RedrawIconTitle( hwnd ); - else - NC_DoNCPaint( hwnd, (HRGN)1 ); + NC_DoNCPaint( hwnd, (HRGN)1 );
if (GetAncestor( hwnd, GA_PARENT ) == GetDesktopWindow()) PostMessageW( GetDesktopWindow(), WM_PARENTNOTIFY, WM_NCACTIVATE, (LPARAM)hwnd ); @@ -1372,17 +1361,14 @@ LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) }
case HTSYSMENU: - if( style & WS_SYSMENU ) - { - if( !(style & WS_MINIMIZE) ) - { - HDC hDC = GetWindowDC(hwnd); - NC_DrawSysButton( hwnd, hDC, TRUE ); - ReleaseDC( hwnd, hDC ); - } - SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, lParam ); - } - break; + if (style & WS_SYSMENU) + { + HDC hDC = GetWindowDC( hwnd ); + NC_DrawSysButton( hwnd, hDC, TRUE ); + ReleaseDC( hwnd, hDC ); + SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, lParam ); + } + break;
case HTMENU: SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/nonclient.c | 1 - dlls/user32/winpos.c | 5 ----- 2 files changed, 6 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 0e15e954fa..372b1be707 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -473,7 +473,6 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
style = GetWindowLongW( hwnd, GWL_STYLE ); ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); - if (style & WS_MINIMIZE) return HTCAPTION;
if (PtInRect( &rcClient, pt )) return HTCLIENT;
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 4a28a6fbab..acd748f13c 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -305,11 +305,6 @@ HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) LONG style = GetWindowLongW( list[i], GWL_STYLE );
/* If window is minimized or disabled, return at once */ - if (style & WS_MINIMIZE) - { - *hittest = HTCAPTION; - break; - } if (style & WS_DISABLED) { *hittest = HTERROR;
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47900
Your paranoid android.
=== debian9 (32 bit Chinese:China report) ===
user32: clipboard.c:760: Test failed: 6: gle 5 clipboard.c:765: Test failed: 6.0: got 0000 instead of 0008 clipboard.c:805: Test failed: 6: gle 1418 clipboard.c:815: Test failed: 6: count 3 clipboard.c:818: Test failed: 6: gle 1418 clipboard.c:852: Test failed: 6: format 0008 got data 0x129c00 clipboard.c:853: Test failed: 6.0: formats 00000000 have been rendered clipboard.c:858: Test failed: 6.0: formats 00000000 have been rendered clipboard.c:852: Test failed: 6: format 0002 got data 0x50045 clipboard.c:853: Test failed: 6.1: formats 00000000 have been rendered clipboard.c:858: Test failed: 6.1: formats 00000000 have been rendered clipboard.c:852: Test failed: 6: format 0011 got data 0x12a488 clipboard.c:853: Test failed: 6.2: formats 00000000 have been rendered clipboard.c:858: Test failed: 6.2: formats 00000000 have been rendered
=== debian9 (64 bit WoW report) ===
user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/controls.h | 3 -- dlls/user32/icontitle.c | 26 --------------- dlls/user32/tests/msg.c | 2 +- dlls/user32/win.c | 3 -- dlls/user32/win.h | 2 -- dlls/user32/winpos.c | 74 ----------------------------------------- 6 files changed, 1 insertion(+), 109 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 164164506e..d372bafcef 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -155,9 +155,6 @@ extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN; /* desktop */ extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
-/* icon title */ -extern HWND ICONTITLE_Create( HWND hwnd ) DECLSPEC_HIDDEN; - /* menu controls */ extern HWND MENU_IsMenuActive(void) DECLSPEC_HIDDEN; extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth, diff --git a/dlls/user32/icontitle.c b/dlls/user32/icontitle.c index 77e286ebc1..e10717de41 100644 --- a/dlls/user32/icontitle.c +++ b/dlls/user32/icontitle.c @@ -51,32 +51,6 @@ const struct builtin_class_descr ICONTITLE_builtin_class = 0 /* brush */ };
- - -/*********************************************************************** - * ICONTITLE_Create - */ -HWND ICONTITLE_Create( HWND owner ) -{ - HWND hWnd; - HINSTANCE instance = (HINSTANCE)GetWindowLongPtrA( owner, GWLP_HINSTANCE ); - LONG style = WS_CLIPSIBLINGS; - - if (!IsWindowEnabled(owner)) style |= WS_DISABLED; - if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD ) - hWnd = CreateWindowExA( 0, (LPCSTR)ICONTITLE_CLASS_ATOM, NULL, - style | WS_CHILD, 0, 0, 1, 1, - GetParent(owner), 0, instance, NULL ); - else - hWnd = CreateWindowExA( 0, (LPCSTR)ICONTITLE_CLASS_ATOM, NULL, - style, 0, 0, 1, 1, - owner, 0, instance, NULL ); - WIN_SetOwner( hWnd, owner ); /* MDI depends on this */ - SetWindowLongW( hWnd, GWL_STYLE, - GetWindowLongW( hWnd, GWL_STYLE ) & ~(WS_CAPTION | WS_BORDER) ); - return hWnd; -} - /*********************************************************************** * ICONTITLE_SetTitlePos */ diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index d79d1004d1..53cecd72f1 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -3984,7 +3984,7 @@ static void test_mdi_messages(void) ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
ShowWindow(mdi_child2, SW_MINIMIZE); - ok_sequence(WmMinimizeMDIchildVisibleSeq, "ShowWindow(SW_MINIMIZE):MDI child", TRUE); + ok_sequence(WmMinimizeMDIchildVisibleSeq, "ShowWindow(SW_MINIMIZE):MDI child", FALSE);
ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow()); ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus()); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index dd6142d16c..24b2a2ffd5 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -970,7 +970,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd ) WND *wndPtr; HWND *list; HMENU menu = 0, sys_menu; - HWND icon_title; struct window_surface *surface;
TRACE("%p\n", hwnd ); @@ -1018,7 +1017,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd ) sys_menu = wndPtr->hSysMenu; free_dce( wndPtr->dce, hwnd ); wndPtr->dce = NULL; - icon_title = wndPtr->icon_title; HeapFree( GetProcessHeap(), 0, wndPtr->text ); wndPtr->text = NULL; HeapFree( GetProcessHeap(), 0, wndPtr->pScroll ); @@ -1028,7 +1026,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd ) wndPtr->surface = NULL; WIN_ReleasePtr( wndPtr );
- if (icon_title) DestroyWindow( icon_title ); if (menu) DestroyMenu( menu ); if (sys_menu) DestroyMenu( sys_menu ); if (surface) diff --git a/dlls/user32/win.h b/dlls/user32/win.h index f3bdfd38d9..81b08fc95e 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -49,7 +49,6 @@ typedef struct tagWND RECT normal_rect; /* Normal window rect saved when maximized/minimized */ POINT min_pos; /* Position for minimized window */ POINT max_pos; /* Position for maximized window */ - HWND icon_title; /* Icon title window */ LPWSTR text; /* Window text */ void *pScroll; /* Scroll-bar info */ DWORD dwStyle; /* Window style (from CreateWindow) */ @@ -120,7 +119,6 @@ static inline void WIN_ReleasePtr( WND *ptr )
extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN;
-extern BOOL WINPOS_RedrawIconTitle( HWND hWnd ) DECLSPEC_HIDDEN; extern MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd ) DECLSPEC_HIDDEN; extern LONG WINPOS_HandleWindowPosChanging(HWND hwnd, WINDOWPOS *winpos) DECLSPEC_HIDDEN; extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index acd748f13c..a938fa9314 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -678,67 +678,6 @@ BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, }
-/*********************************************************************** - * WINPOS_RedrawIconTitle - */ -BOOL WINPOS_RedrawIconTitle( HWND hWnd ) -{ - HWND icon_title = 0; - WND *win = WIN_GetPtr( hWnd ); - - if (win && win != WND_OTHER_PROCESS && win != WND_DESKTOP) - { - icon_title = win->icon_title; - WIN_ReleasePtr( win ); - } - if (!icon_title) return FALSE; - SendMessageW( icon_title, WM_SHOWWINDOW, TRUE, 0 ); - InvalidateRect( icon_title, NULL, TRUE ); - return TRUE; -} - -/*********************************************************************** - * WINPOS_ShowIconTitle - */ -static void WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow ) -{ - WND *win = WIN_GetPtr( hwnd ); - HWND title = 0; - - TRACE("%p %i\n", hwnd, (bShow != 0) ); - - if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return; - if (win->window_rect.left == -32000 || win->window_rect.top == -32000) - { - TRACE( "not showing title for hidden icon %p\n", hwnd ); - bShow = FALSE; - } - else title = win->icon_title; - WIN_ReleasePtr( win ); - - if (bShow) - { - if (!title) - { - title = ICONTITLE_Create( hwnd ); - if (!(win = WIN_GetPtr( hwnd )) || win == WND_OTHER_PROCESS) - { - DestroyWindow( title ); - return; - } - win->icon_title = title; - WIN_ReleasePtr( win ); - } - if (!IsWindowVisible(title)) - { - SendMessageW( title, WM_SHOWWINDOW, TRUE, 0 ); - SetWindowPos( title, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | - SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW ); - } - } - else if (title) ShowWindow( title, SW_HIDE ); -} - /******************************************************************* * WINPOS_GetMinMaxInfo * @@ -1053,10 +992,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
old_style = WIN_SetStyle( hwnd, WS_MAXIMIZE, WS_MINIMIZE ); if (old_style & WS_MINIMIZE) - { win_set_flags( hwnd, WIN_RESTORE_MAX, 0 ); - WINPOS_ShowIconTitle( hwnd, FALSE ); - }
if (!(old_style & WS_MAXIMIZE)) swpFlags |= SWP_STATECHANGED; SetRect( rect, minmax.ptMaxPosition.x, minmax.ptMaxPosition.y, @@ -1072,7 +1008,6 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) old_style = WIN_SetStyle( hwnd, 0, WS_MINIMIZE | WS_MAXIMIZE ); if (old_style & WS_MINIMIZE) { - WINPOS_ShowIconTitle( hwnd, FALSE ); if (win_get_flags( hwnd ) & WIN_RESTORE_MAX) { /* Restore to maximized position */ @@ -1202,8 +1137,6 @@ static BOOL show_window( HWND hwnd, INT cmd ) { HWND hFocus;
- WINPOS_ShowIconTitle( hwnd, FALSE ); - /* FIXME: This will cause the window to be activated irrespective * of whether it is owned by the same thread. Has to be done * asynchronously. @@ -1223,8 +1156,6 @@ static BOOL show_window( HWND hwnd, INT cmd ) goto done; }
- if (IsIconic(hwnd)) WINPOS_ShowIconTitle( hwnd, TRUE ); - if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) goto done;
if (wndPtr->flags & WIN_NEED_SIZE) @@ -1477,7 +1408,6 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f { if (flags & PLACE_MIN) { - WINPOS_ShowIconTitle( hwnd, FALSE ); SetWindowPos( hwnd, 0, wp.ptMinPosition.x, wp.ptMinPosition.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); } @@ -1498,8 +1428,6 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
if (IsIconic( hwnd )) { - if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE) WINPOS_ShowIconTitle( hwnd, TRUE ); - /* SDK: ...valid only the next time... */ if( wndpl->flags & WPF_RESTORETOMAXIMIZED ) win_set_flags( hwnd, WIN_RESTORE_MAX, 0 ); @@ -2947,7 +2875,6 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) { hOldCursor = SetCursor(hDragCursor); ShowCursor( TRUE ); - WINPOS_ShowIconTitle( hwnd, FALSE ); } else if(!DragFullWindows) draw_moving_frame( parent, hdc, &sizingRect, thickframe ); @@ -3051,6 +2978,5 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); } - else WINPOS_ShowIconTitle( hwnd, TRUE ); } }
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47893
Your paranoid android.
=== debian9 (32 bit WoW report) ===
user32: menu.c:2354: Test failed: test 27