From 0edc848bee16ae2115f47e2a09435cc1b3834eb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Bernon?= Date: Mon, 29 May 2023 14:33:06 +0200 Subject: [PATCH] explorer: Don't call driver create_desktop if desktop name is "root". --- dlls/winex11.drv/desktop.c | 11 ----------- programs/explorer/desktop.c | 6 ++++-- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 26350fbe558..17431f8215e 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -359,21 +359,10 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ) */ NTSTATUS x11drv_create_desktop( void *arg ) { - static const WCHAR rootW[] = {'r','o','o','t',0}; const struct create_desktop_params *params = arg; XSetWindowAttributes win_attr; Window win; Display *display = thread_init_display(); - WCHAR name[MAX_PATH]; - - if (!NtUserGetObjectInformation( NtUserGetThreadDesktop( GetCurrentThreadId() ), - UOI_NAME, name, sizeof(name), NULL )) - name[0] = 0; - - TRACE( "%s %ux%u\n", debugstr_w(name), params->width, params->height ); - - /* magic: desktop "root" means use the root window */ - if (!wcsicmp( 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 59a12464291..5c265b9c56b 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(explorer); static const WCHAR default_driver[] = {'m','a','c',',','x','1','1',0}; -static BOOL using_root; +static BOOL using_root = TRUE; struct launcher { @@ -1089,6 +1089,8 @@ void manage_desktop( WCHAR *arg ) if (name && width && height) { + /* magic: desktop "root" means use the root window */ + using_root = !wcsicmp( name, L"root" ); if (!(desktop = CreateDesktopW( name, NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ))) { WINE_ERR( "failed to create desktop %s error %ld\n", wine_dbgstr_w(name), GetLastError() ); @@ -1109,7 +1111,7 @@ void manage_desktop( WCHAR *arg ) desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)desktop_wnd_proc ); - using_root = !desktop || !create_desktop( graphics_driver, name, width, height ); + if (!using_root) using_root = !create_desktop( graphics_driver, name, width, height ); SendMessageW( hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconW( 0, MAKEINTRESOURCEW(OIC_WINLOGO))); if (name) set_desktop_window_title( hwnd, name ); SetWindowPos( hwnd, 0, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), -- 2.11.4.GIT