winex11.drv: Move the desktop fullscreen check after desktop init.

After 25167fb286, 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>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2019-11-05 21:05:31 +08:00 committed by Alexandre Julliard
parent acf03ed9da
commit b7b4bacaf9
1 changed files with 3 additions and 5 deletions

View File

@ -281,7 +281,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() ),
@ -308,18 +307,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;
}