From 6c6814056f067f863a4cf47f756c9336dcdf8afc Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 26 May 2016 21:47:51 +0900 Subject: [PATCH] winex11: Subtract the tray window from the work area in desktop mode. Signed-off-by: Alexandre Julliard --- dlls/winex11.drv/xinerama.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index 7e28726f688..0419535d494 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -87,6 +87,20 @@ static void query_work_area( RECT *rc_work ) } } +static void query_desktop_work_area( RECT *rc_work ) +{ + static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0}; + RECT rect; + HWND hwnd = FindWindowW( trayW, NULL ); + + if (!hwnd || !IsWindowVisible( hwnd )) return; + if (!GetWindowRect( hwnd, &rect )) return; + if (rect.top) rc_work->bottom = rect.top; + else rc_work->top = rect.bottom; + TRACE( "found tray %p %s work area %s\n", hwnd, + wine_dbgstr_rect( &rect ), wine_dbgstr_rect( rc_work )); +} + #ifdef SONAME_LIBXINERAMA #define MAKE_FUNCPTR(f) static typeof(f) * p##f @@ -198,6 +212,8 @@ void xinerama_init( unsigned int width, unsigned int height ) default_monitor.rcWork = default_monitor.rcMonitor = rect; if (root_window == DefaultRootWindow( gdi_display )) query_work_area( &default_monitor.rcWork ); + else + query_desktop_work_area( &default_monitor.rcWork ); nb_monitors = 1; monitors = &default_monitor; }