From ef456af6e5169f4f4897bb0231b6c23ace36ba5e Mon Sep 17 00:00:00 2001
From: Gerard Patel <gerard.patel@asi.fr>
Date: Fri, 15 Dec 2000 21:29:13 +0000
Subject: [PATCH] Don't return last active popup if it is pointing to a deleted
 window.

---
 windows/win.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/windows/win.c b/windows/win.c
index 4500a21af77..99489b16e17 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -2766,6 +2766,8 @@ HWND WINAPI GetLastActivePopup( HWND hwnd )
     if (!wndPtr) return hwnd;
     retval = wndPtr->hwndLastActive;
     WIN_ReleaseWndPtr(wndPtr);
+    if ((retval != hwnd) && (!IsWindow(retval)))
+       retval = hwnd;
     return retval;
 }
 
-- 
GitLab