]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
provide access to the desktop names
[chaz/openbox] / src / client.cc
index 8a3a46b81fa031246f5e831dca05ca1e50a3e9ec..33e11ce07e1e596621acb3c61fe5070e8feabc38 100644 (file)
@@ -764,12 +764,17 @@ void Client::setDesktop(unsigned int target)
 
 void Client::showhide()
 {
-  if (!_iconic &&
-      (_desktop == openbox->screen(_screen)->desktop() ||
-       _desktop == 0xffffffff))
-    frame->show();
-  else
-    frame->hide();
+  bool show;
+  Screen *s = openbox->screen(_screen);
+
+  if (_iconic) show = false;
+  else if (!(_desktop == s->desktop() ||
+             _desktop == 0xffffffff)) show = false;
+  else if (normal() && s->showingDesktop()) show = false;
+  else show = true;
+
+  if (show) frame->show();
+  else      frame->hide();
 }
 
 
@@ -1012,15 +1017,23 @@ void Client::clientMessageHandler(const XClientMessageEvent &e)
 #ifdef DEBUG
     printf("net_active_window for 0x%lx\n", _window);
 #endif
+    if (openbox->screen(_screen)->showingDesktop())
+      openbox->screen(_screen)->showDesktop(false);
     if (_iconic)
       iconify(false);
+    else if (!frame->visible()) // if its not visible for other reasons, then
+      return;                   // don't mess with it
     if (_shaded)
       shade(false);
     focus();
     openbox->screen(_screen)->raiseWindow(this);
   } else if (e.message_type == otk::Property::atoms.openbox_active_window) {
+    if (openbox->screen(_screen)->showingDesktop())
+      openbox->screen(_screen)->showDesktop(false);
     if (_iconic)
       iconify(false);
+    else if (!frame->visible()) // if its not visible for other reasons, then
+      return;                   // don't mess with it
     if (e.data.l[0] && _shaded)
       shade(false);
     focus();
@@ -1548,6 +1561,10 @@ void Client::iconify(bool iconic, bool curdesk)
 {
   if (_iconic == iconic) return; // nothing to do
 
+#ifdef DEBUG
+    printf("%sconifying window: 0x%lx\n", (iconic ? "I" : "Uni"), _window);
+#endif
+
   _iconic = iconic;
 
   if (_iconic) {
This page took 0.022241 seconds and 4 git commands to generate.