]> Dogcows Code - chaz/openbox/commitdiff
make some funcs const, and don't try focus a client if it is not visible
authorDana Jansens <danakj@orodu.net>
Wed, 8 Jan 2003 06:45:01 +0000 (06:45 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 8 Jan 2003 06:45:01 +0000 (06:45 +0000)
src/client.cc

index 026f4f2f8bd6b7aad78f12ded2fda0c7a52dab0b..2c6ec5e5fed561805218bcaf1c90df3bcf50e8f6 100644 (file)
@@ -1082,9 +1082,12 @@ void OBClient::shade(bool shade)
 }
 
 
-bool OBClient::focus()
+bool OBClient::focus() const
 {
-  if (!(_can_focus || _focus_notify)) return false;
+  // won't try focus if the client doesn't want it, or if the window isn't
+  // visible on the screen
+  if (!(frame->isVisible() && (_can_focus || _focus_notify))) return false;
+
   if (_focused) return true;
 
   if (_can_focus)
@@ -1112,7 +1115,7 @@ bool OBClient::focus()
 }
 
 
-void OBClient::unfocus()
+void OBClient::unfocus() const
 {
   if (!_focused) return;
 
@@ -1269,8 +1272,14 @@ void OBClient::reparentHandler(const XReparentEvent &e)
     to an already unmapped window.
   */
 
+  // we don't want the reparent event, put it back on the stack for the X
+  // server to deal with after we unmanage the window
+  XEvent ev;
+  ev.xreparent = e;
+  XPutBackEvent(otk::OBDisplay::display, &ev);
+  
   // this deletes us etc
-  Openbox::instance->screen(_screen)->unmanageWindow(this, true);
+  Openbox::instance->screen(_screen)->unmanageWindow(this);
 }
 
 }
This page took 0.027033 seconds and 4 git commands to generate.