]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
make the 'toggle all desktops' button work
[chaz/openbox] / src / client.cc
index b36ba9aff2a6fe9bdf701b5f1de4f848b7396f56..54afbc9a6d4d0cecf96491c43ec8c701d78a6685 100644 (file)
@@ -169,7 +169,7 @@ void Client::getType()
 void Client::setupDecorAndFunctions()
 {
   // start with everything (cept fullscreen)
-  _decorations = Decor_Titlebar | Decor_Handle | Decor_Border |
+  _decorations = Decor_Titlebar | Decor_Handle | Decor_Border | Decor_Sticky |
     Decor_Iconify | Decor_Maximize;
   _functions = Func_Resize | Func_Move | Func_Iconify | Func_Maximize |
     Func_Shade;
@@ -655,6 +655,8 @@ void Client::setDesktop(long target)
     frame->show();
   else
     frame->hide();
+
+  frame->adjustState();
 }
 
 
@@ -1072,6 +1074,9 @@ void Client::changeState()
                      otk::Property::atoms.atom, netstate, num);
 
   calcLayer();
+
+  if (frame)
+    frame->adjustState();
 }
 
 
@@ -1196,6 +1201,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.026518 seconds and 4 git commands to generate.