From 386b9d034b6b8e9164c0449e623ef22e0c9808e9 Mon Sep 17 00:00:00 2001
From: rathnor <rathnor>
Date: Fri, 30 Apr 2004 13:11:40 +0000
Subject: reparent tweak

---
 ChangeLog     |  3 +++
 src/Window.cc | 13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bb8453c..55da8fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 (Format: Year/Month/Day)
 Changes for 0.9.10:
+*04/04/30:
+  * fix up reparent issue that affects java menus (thanks Scott Moser)
+    Window.cc
 *04/04/28:
   * Fix key bindings for directional focus movement (Simon)
     - reminder, key actions are: FocusUp, FocusDown, FocusLeft, FocusRight
diff --git a/src/Window.cc b/src/Window.cc
index ff93633..868d4a8 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Window.cc,v 1.282 2004/04/22 21:07:57 fluxgen Exp $
+// $Id: Window.cc,v 1.283 2004/04/30 13:11:40 rathnor Exp $
 
 #include "Window.hh"
 
@@ -3138,19 +3138,24 @@ void FluxboxWindow::restore(WinClient *client, bool remap) {
     // Why was this hide done? It broke vncviewer (and mplayer?), 
     // since it would reparent when going fullscreen.
     // is it needed for anything? Reparent should imply unmap
+    // ok, it should hide sometimes, e.g. if the reparent was sent by a client
     //client->hide();
 
     // restore old border width
     client->setBorderWidth(client->old_bw);
 
-    XEvent not_used;
+    XEvent xev;
     if (! XCheckTypedWindowEvent(display, client->window(), ReparentNotify,
-                                 &not_used)) {
+                                 &xev)) {
 #ifdef DEBUG
         cerr<<"FluxboxWindow::restore: reparent 0x"<<hex<<client->window()<<dec<<" to root"<<endl;
 #endif // DEBUG
         // reparent to root window
-        client->reparent(screen().rootWindow().window(), frame().x(), frame().y());        
+        client->reparent(screen().rootWindow().window(), frame().x(), frame().y());
+
+        if(xev.xreparent.send_event) {
+            client->hide();
+        }
     }
 
     if (remap)
-- 
cgit v0.11.2