Skip to content

Commit

Permalink
explorer: Don't call driver create_desktop if desktop name is "root".
Browse files Browse the repository at this point in the history
  • Loading branch information
rbernon authored and julliard committed May 30, 2023
1 parent dbb6398 commit 0edc848
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
11 changes: 0 additions & 11 deletions dlls/winex11.drv/desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
6 changes: 4 additions & 2 deletions programs/explorer/desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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() );
Expand All @@ -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),
Expand Down

0 comments on commit 0edc848

Please sign in to comment.