Zhiyi Zhang : winex11.drv: Initialize display devices before getting primary desktop rectangle.

Alexandre Julliard julliard at winehq.org
Mon Sep 23 15:22:34 CDT 2019


Module: wine
Branch: master
Commit: efbbe66669a060dd01b3ae399f5a9e7328312f03
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=efbbe66669a060dd01b3ae399f5a9e7328312f03

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Fri Sep 20 16:54:31 2019 +0800

winex11.drv: Initialize display devices before getting primary desktop rectangle.

Otherwise, the retrieved primary desktop might be from the last explorer instance
if we launch new explorer instances before wine server fully shuts down.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/desktop.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index ecbcd6b381..fed8dd32e9 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -147,15 +147,18 @@ static LONG X11DRV_desktop_SetCurrentMode(int mode)
  */
 void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
 {
-    RECT primary_rect = get_primary_monitor_rect();
+    RECT primary_rect;
 
     root_window = win;
     managed_mode = FALSE;  /* no managed windows in desktop mode */
-    max_width = primary_rect.right - primary_rect.left;
-    max_height = primary_rect.bottom - primary_rect.top;
+
     xinerama_init( width, height );
     X11DRV_DisplayDevices_Init( TRUE );
 
+    primary_rect = get_primary_monitor_rect();
+    max_width = primary_rect.right - primary_rect.left;
+    max_height = primary_rect.bottom - primary_rect.top;
+
     /* initialize the available resolutions */
     dd_modes = X11DRV_Settings_SetHandlers("desktop", 
                                            X11DRV_desktop_GetCurrentMode, 




More information about the wine-cvs mailing list