Update wine to 1.2.
[sugaredwine.git] / patches / 0003-explorer-set-the-work-area-when-appbars-change.patch
blob6af37fcf320bbf166ace58a24e0f4b1d66cbedaa
1 From 3d7082366da50e6abd00a20b4b350b4ff6205231 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 ca3698e..429b4b6 100644
12 --- a/programs/explorer/appbar.c
13 +++ b/programs/explorer/appbar.c
14 @@ -133,6 +133,41 @@ static void appbar_cliprect( HWND hwnd, RECT *rect )
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, struct appbar_data_msg *abd)
55 struct appbar_data* data;
56 @@ -167,6 +202,8 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd)
57 send_poschanged(hwnd);
59 HeapFree(GetProcessHeap(), 0, data);
61 + refresh_workarea();
63 else
64 WINE_WARN("removing hwnd %p not on the list\n", hwnd);
65 @@ -194,6 +231,8 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *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