From 8b5bdb10d586d069e3ed5bc5138015f742a9183b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 29 May 2023 13:52:16 +0200 Subject: [PATCH] win32u: Call SetDesktopWindow when desktop window is successfully created. When the default desktop window is created, its parent is always NULL, and SetDesktopWindow is never called here. --- dlls/win32u/window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 599a0b7300e..e1cd80f8a36 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4950,10 +4950,10 @@ static WND *create_window_handle( HWND parent, HWND owner, UNICODE_STRING *name, if (name->Buffer == (const WCHAR *)DESKTOP_CLASS_ATOM) { - if (!thread_info->top_window) - thread_info->top_window = HandleToUlong( full_parent ? full_parent : handle ); + if (!thread_info->top_window) thread_info->top_window = HandleToUlong( full_parent ? full_parent : handle ); else assert( full_parent == UlongToHandle( thread_info->top_window )); - if (full_parent) user_driver->pSetDesktopWindow( UlongToHandle( thread_info->top_window )); + if (!thread_info->top_window) ERR_(win)( "failed to create desktop window\n" ); + else user_driver->pSetDesktopWindow( UlongToHandle( thread_info->top_window )); register_builtin_classes(); } else /* HWND_MESSAGE parent */