]> Dogcows Code - chaz/openbox/commitdiff
check if the window exists before trying to focus it
authorDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 03:44:18 +0000 (03:44 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 03:44:18 +0000 (03:44 +0000)
src/client.cc

index b36ba9aff2a6fe9bdf701b5f1de4f848b7396f56..f12e643ac22196cfcffd6b63bae0cc340cf280ac 100644 (file)
@@ -1196,6 +1196,14 @@ bool Client::focus() const
 
   if (_focused) return true;
 
+  // do a check to see if the window has already been unmapped or destroyed
+  XEvent ev;
+  if (XCheckTypedWindowEvent(**otk::display, _window, UnmapNotify, &ev) ||
+      XCheckTypedWindowEvent(**otk::display, _window, DestroyNotify, &ev)) {
+    XPutBackEvent(**otk::display, &ev);
+    return false;
+  }
+
   if (_can_focus)
     XSetInputFocus(**otk::display, _window,
                    RevertToNone, CurrentTime);
This page took 0.024674 seconds and 4 git commands to generate.