From 87bb58803a171ed486f7396b19ba7baf9cfc76d2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 20 Jun 2006 08:55:43 +0000 Subject: [PATCH] Another attempt at the window stacking problem in WIN32. It does fix the issue described in STR #1296 without the negative effects described by Torsten Giebl. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5217 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Fl.cxx b/src/Fl.cxx index 600759b1e..d1a6ee812 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -952,7 +952,12 @@ void Fl_Window::hide() { if (ip->region) XDestroyRegion(ip->region); #ifdef WIN32 - CloseWindow(ip->xid); + // this little trickery seems to avoid the popup window stacking problem + HWND p = GetForegroundWindow(); + if (p==GetParent(ip->xid)) { + ShowWindow(ip->xid, SW_HIDE); + ShowWindow(p, SW_SHOWNA); + } XDestroyWindow(fl_display, ip->xid); #elif defined(__APPLE_QD__) if ( !parent() ) // don't destroy shared windows!