From b19c57ca71ca2f3b77a142509b9335d0f5f8e3ce Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 10 May 2001 21:06:56 +0000 Subject: [PATCH] Fixed reparenting to desktop (found by Gerard Patel). --- dlls/x11drv/window.c | 5 +++-- windows/win.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c index 4a417a9b3c4..4508b99cb8b 100644 --- a/dlls/x11drv/window.c +++ b/dlls/x11drv/window.c @@ -398,8 +398,9 @@ HWND X11DRV_SetParent( HWND hwnd, HWND parent ) dwStyle = wndPtr->dwStyle; - pWndParent = parent ? WIN_FindWndPtr(parent) : WIN_GetDesktop(); - if (!pWndParent) + if (!parent) parent = GetDesktopWindow(); + + if (!(pWndParent = WIN_FindWndPtr(parent))) { WIN_ReleaseWndPtr( wndPtr ); return 0; diff --git a/windows/win.c b/windows/win.c index bec9352600e..6f0faed670b 100644 --- a/windows/win.c +++ b/windows/win.c @@ -2391,8 +2391,9 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent ) dwStyle = wndPtr->dwStyle; - pWndParent = parent ? WIN_FindWndPtr(parent) : WIN_GetDesktop(); - if (!pWndParent) + if (!parent) parent = GetDesktopWindow(); + + if (!(pWndParent = WIN_FindWndPtr(parent))) { WIN_ReleaseWndPtr( wndPtr ); return 0; -- 2.11.4.GIT