Module: wine Branch: master Commit: f8096d2b84f29e2352e536b20d5e2d93d9fd0f47 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f8096d2b84f29e2352e536b20d...
Author: Aric Stewart aric@codeweavers.com Date: Wed Aug 27 12:31:14 2008 -0500
systray: Keep systray hidden when requested by moving it off screen.
---
programs/explorer/systray.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 8b82d9a..07e683a 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -430,6 +430,14 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds) return ret; }
+static void do_hide_systray(void) +{ + SetWindowPos( tray_window, 0, + GetSystemMetrics(SM_XVIRTUALSCREEN) + GetSystemMetrics(SM_CXVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN) + GetSystemMetrics(SM_CYVIRTUALSCREEN), + 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); +} + static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -437,6 +445,10 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l case WM_COPYDATA: return handle_incoming((HWND)wparam, (COPYDATASTRUCT *)lparam);
+ case WM_DISPLAYCHANGE: + if (hide_systray) do_hide_systray(); + break; + case WM_TIMER: cleanup_destroyed_windows(); break; @@ -568,5 +580,8 @@ void initialize_systray(void) WINE_ERR("Could not create tray window\n"); return; } + + if (hide_systray) do_hide_systray(); + SetTimer( tray_window, 1, 2000, NULL ); }