diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 59affca1b1d..06ce26ed2e4 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2404,6 +2404,16 @@ void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags release_win_data( data ); } +/* check if the window icon should be hidden (i.e. moved off-screen) */ +static BOOL hide_icon( struct x11drv_win_data *data ) +{ + static const WCHAR trayW[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0}; + + if (data->managed) return TRUE; + /* hide icons in desktop mode when the taskbar is active */ + if (root_window == DefaultRootWindow( gdi_display )) return FALSE; + return IsWindowVisible( FindWindowW( trayW, NULL )); +} /*********************************************************************** * ShowWindow (X11DRV.@) @@ -2418,18 +2428,18 @@ UINT CDECL X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) struct x11drv_thread_data *thread_data = x11drv_thread_data(); struct x11drv_win_data *data = get_win_data( hwnd ); - if (!data || !data->whole_window || !data->managed) goto done; + if (!data || !data->whole_window) goto done; if (IsRectEmpty( rect )) goto done; if (style & WS_MINIMIZE) { - if (rect->left != -32000 || rect->top != -32000) + if (((rect->left != -32000 || rect->top != -32000)) && hide_icon( data )) { OffsetRect( rect, -32000 - rect->left, -32000 - rect->top ); swp &= ~(SWP_NOMOVE | SWP_NOCLIENTMOVE); } goto done; } - if (!data->mapped || data->iconic) goto done; + if (!data->managed || !data->mapped || data->iconic) goto done; /* only fetch the new rectangle if the ShowWindow was a result of a window manager event */