After 25167fb286822c93582457815bcf069fef040976, get_primary_monitor_rect(), which is used in is_window_rect_fullscreen(), may return the primary screen size set by the last explorer instance if wineserver didn't fully shuts down. Also get_primary_monitor_rect() no longer reports the host primary monitor rect before virtual desktop initialization now. So move the desktop fullscreen check after desktop initialization so that primary screen size is updated and valid.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/winex11.drv/desktop.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 9f2eb1d41f..1185874d46 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -286,7 +286,6 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height ) XSetWindowAttributes win_attr; Window win; Display *display = thread_init_display(); - RECT rect; WCHAR name[MAX_PATH];
if (!GetUserObjectInformationW( GetThreadDesktop( GetCurrentThreadId() ), @@ -313,18 +312,17 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height ) 0, 0, width, height, 0, default_visual.depth, InputOutput, default_visual.visual, CWEventMask | CWCursor | CWColormap, &win_attr ); if (!win) return FALSE; + if (!create_desktop_win_data( win )) return FALSE;
- SetRect( &rect, 0, 0, width, height ); - if (is_window_rect_fullscreen( &rect )) + X11DRV_init_desktop( win, width, height ); + if (is_desktop_fullscreen()) { TRACE("setting desktop to fullscreen\n"); XChangeProperty( display, win, x11drv_atom(_NET_WM_STATE), XA_ATOM, 32, PropModeReplace, (unsigned char*)&x11drv_atom(_NET_WM_STATE_FULLSCREEN), 1); } - if (!create_desktop_win_data( win )) return FALSE; XFlush( display ); - X11DRV_init_desktop( win, width, height ); return TRUE; }