[PATCH 4/5] winex11.drv: Move the desktop fullscreen check after desktop init.

Zhiyi Zhang zzhang at codeweavers.com
Tue Nov 5 07:05:31 CST 2019


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 at 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 2428293c4f..d70b38b2b3 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -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;
 }
 
-- 
2.23.0




More information about the wine-devel mailing list