update Wine to wine-1.1.28
[sugaredwine.git] / patches / 0006-user32-hack-to-hide-minimized-window-icons.patch
blob97b1a457cb7c0a8c25a98f6135a3545010682185
1 From 586e65c52387f5e3ee0436300a6733a3b0e0a1db Mon Sep 17 00:00:00 2001
2 From: Vincent Povirk <vincent@codeweavers.com>
3 Date: Tue, 23 Sep 2008 09:24:06 -0500
4 Subject: [PATCH] user32: hack to hide minimized window icons
6 ---
7 dlls/user32/winpos.c | 54 +------------------------------------------------
8 1 files changed, 2 insertions(+), 52 deletions(-)
10 diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
11 index 8aeecc2..a59f722 100644
12 --- a/dlls/user32/winpos.c
13 +++ b/dlls/user32/winpos.c
14 @@ -783,58 +783,8 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
16 static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt )
18 - RECT rect, rectParent;
19 - HWND parent, child;
20 - HRGN hrgn, tmp;
21 - int xspacing, yspacing;
23 - parent = GetAncestor( hwnd, GA_PARENT );
24 - GetClientRect( parent, &rectParent );
25 - if ((pt.x >= rectParent.left) && (pt.x + GetSystemMetrics(SM_CXICON) < rectParent.right) &&
26 - (pt.y >= rectParent.top) && (pt.y + GetSystemMetrics(SM_CYICON) < rectParent.bottom))
27 - return pt; /* The icon already has a suitable position */
29 - xspacing = GetSystemMetrics(SM_CXICONSPACING);
30 - yspacing = GetSystemMetrics(SM_CYICONSPACING);
32 - /* Check if another icon already occupies this spot */
33 - /* FIXME: this is completely inefficient */
35 - hrgn = CreateRectRgn( 0, 0, 0, 0 );
36 - tmp = CreateRectRgn( 0, 0, 0, 0 );
37 - for (child = GetWindow( parent, GW_HWNDFIRST ); child; child = GetWindow( child, GW_HWNDNEXT ))
38 - {
39 - WND *childPtr;
40 - if (child == hwnd) continue;
41 - if ((GetWindowLongW( child, GWL_STYLE ) & (WS_VISIBLE|WS_MINIMIZE)) != (WS_VISIBLE|WS_MINIMIZE))
42 - continue;
43 - if (!(childPtr = WIN_GetPtr( child )) || childPtr == WND_OTHER_PROCESS)
44 - continue;
45 - SetRectRgn( tmp, childPtr->rectWindow.left, childPtr->rectWindow.top,
46 - childPtr->rectWindow.right, childPtr->rectWindow.bottom );
47 - CombineRgn( hrgn, hrgn, tmp, RGN_OR );
48 - WIN_ReleasePtr( childPtr );
49 - }
50 - DeleteObject( tmp );
52 - for (rect.bottom = rectParent.bottom; rect.bottom >= yspacing; rect.bottom -= yspacing)
53 - {
54 - for (rect.left = rectParent.left; rect.left <= rectParent.right - xspacing; rect.left += xspacing)
55 - {
56 - rect.right = rect.left + xspacing;
57 - rect.top = rect.bottom - yspacing;
58 - if (!RectInRegion( hrgn, &rect ))
59 - {
60 - /* No window was found, so it's OK for us */
61 - pt.x = rect.left + (xspacing - GetSystemMetrics(SM_CXICON)) / 2;
62 - pt.y = rect.top + (yspacing - GetSystemMetrics(SM_CYICON)) / 2;
63 - DeleteObject( hrgn );
64 - return pt;
65 - }
66 - }
67 - }
68 - DeleteObject( hrgn );
69 - pt.x = pt.y = 0;
70 + pt.x = GetSystemMetrics(SM_CXVIRTUALSCREEN)+1;
71 + pt.y = GetSystemMetrics(SM_CYVIRTUALSCREEN)+1;
72 return pt;
75 --
76 1.5.6.5