Alexandre Julliard : explorer: Move the check for the magic root desktop to the X11 driver.

Alexandre Julliard julliard at winehq.org
Wed Oct 31 15:58:33 CDT 2018


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Oct 31 16:26:38 2018 +0100

explorer: Move the check for the magic root desktop to the X11 driver.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/desktop.c  | 11 ++++++++++-
 programs/explorer/desktop.c |  4 +---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index 559efe2..d478cbd 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -173,12 +173,21 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
  */
 BOOL CDECL X11DRV_create_desktop( UINT width, UINT height )
 {
+    static const WCHAR rootW[] = {'r','o','o','t',0};
     XSetWindowAttributes win_attr;
     Window win;
     Display *display = thread_init_display();
     RECT rect;
+    WCHAR name[MAX_PATH];
 
-    TRACE( "%u x %u\n", width, height );
+    if (!GetUserObjectInformationW( GetThreadDesktop( GetCurrentThreadId() ),
+                                    UOI_NAME, name, sizeof(name), NULL ))
+        name[0] = 0;
+
+    TRACE( "%s %ux%u\n", debugstr_w(name), width, height );
+
+    /* magic: desktop "root" means use the root window */
+    if (!lstrcmpiW( name, rootW )) return FALSE;
 
     /* Create window */
     win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | EnterWindowMask |
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index ff58204..d802bc3 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -670,12 +670,10 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR
 /* create the desktop and the associated driver window, and make it the current desktop */
 static BOOL create_desktop( HMODULE driver, const WCHAR *name, unsigned int width, unsigned int height )
 {
-    static const WCHAR rootW[] = {'r','o','o','t',0};
     BOOL ret = FALSE;
     BOOL (CDECL *create_desktop_func)(unsigned int, unsigned int);
 
-    /* magic: desktop "root" means use the root window */
-    if (driver && strcmpiW( name, rootW ))
+    if (driver)
     {
         create_desktop_func = (void *)GetProcAddress( driver, "wine_create_desktop" );
         if (create_desktop_func) ret = create_desktop_func( width, height );




More information about the wine-cvs mailing list