update wine to wine-1.1.20
[sugaredwine.git] / patches / 0003-explorer-set-the-work-area-when-appbars-change.patch
blob2c0b5450cdb05f80cc07d5a22e53ffaa0129ab05
1 From 9819e461a169a6af9a1d45741141bb6ff54e1ca2 Mon Sep 17 00:00:00 2001
2 From: Vincent Povirk <vincent@codeweavers.com>
3 Date: Tue, 23 Sep 2008 16:23:04 -0500
4 Subject: [PATCH] explorer: set the work area when appbars change
6 ---
7 programs/explorer/appbar.c | 39 +++++++++++++++++++++++++++++++++++++++
8 1 files changed, 39 insertions(+), 0 deletions(-)
10 diff --git a/programs/explorer/appbar.c b/programs/explorer/appbar.c
11 index 2947ccd..f063ea2 100644
12 --- a/programs/explorer/appbar.c
13 +++ b/programs/explorer/appbar.c
14 @@ -124,6 +124,41 @@ static void appbar_cliprect(PAPPBARDATA abd)
18 +static void refresh_workarea(void)
20 + struct appbar_data* data;
21 + RECT rc;
23 + rc.left = 0;
24 + rc.top = 0;
25 + rc.right = GetSystemMetrics(SM_CXSCREEN);
26 + rc.bottom = GetSystemMetrics(SM_CYSCREEN);
28 + LIST_FOR_EACH_ENTRY(data, &appbars, struct appbar_data, entry)
29 + {
30 + if (data->space_reserved)
31 + {
32 + switch (data->edge)
33 + {
34 + case ABE_BOTTOM:
35 + rc.bottom = min(rc.bottom, data->rc.top);
36 + break;
37 + case ABE_LEFT:
38 + rc.left = max(rc.left, data->rc.right);
39 + break;
40 + case ABE_RIGHT:
41 + rc.right = min(rc.right, data->rc.left);
42 + break;
43 + case ABE_TOP:
44 + rc.top = max(rc.top, data->rc.bottom);
45 + break;
46 + }
47 + }
48 + }
50 + SystemParametersInfoW(SPI_SETWORKAREA, 0, (void*)&rc, 0);
53 static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
55 struct appbar_data* data;
56 @@ -157,6 +192,8 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
57 send_poschanged(abd->hWnd);
59 HeapFree(GetProcessHeap(), 0, data);
61 + refresh_workarea();
63 else
64 WINE_WARN("removing hwnd %p not on the list\n", abd->hWnd);
65 @@ -184,6 +221,8 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
66 data->edge = abd->uEdge;
67 data->rc = abd->rc;
68 data->space_reserved = TRUE;
70 + refresh_workarea();
72 else
74 --
75 1.5.6.5