]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
dont hide windows when switching to the current workspace
[chaz/openbox] / src / client.cc
index 298e5f56a64f90b4296bebd070a26730f60d3c6f..f07de8df40d8d6d00c91bf2b5d3b380cb6f90806 100644 (file)
@@ -91,9 +91,15 @@ void OBClient::getDesktop()
   // defaults to the current desktop
   _desktop = Openbox::instance->screen(_screen)->desktop();
 
-  property->get(_window, otk::OBProperty::net_wm_desktop,
-                otk::OBProperty::Atom_Cardinal,
-                (long unsigned*)&_desktop);
+  if (!property->get(_window, otk::OBProperty::net_wm_desktop,
+                     otk::OBProperty::Atom_Cardinal,
+                     (long unsigned*)&_desktop)) {
+    // make sure the hint exists
+    Openbox::instance->property()->set(_window,
+                                       otk::OBProperty::net_wm_desktop,
+                                       otk::OBProperty::Atom_Cardinal,
+                                       (unsigned)_desktop);
+  }
 }
 
 
@@ -649,12 +655,23 @@ void OBClient::setWMState(long state)
 
 void OBClient::setDesktop(long target)
 {
+  if (target == _desktop) return;
+  
   printf("Setting desktop %ld\n", target);
   assert(target >= 0 || target == (signed)0xffffffff);
   //assert(target == 0xffffffff || target < MAX);
 
-  // XXX: move the window to the new desktop (and set root property)
+  if (!(target >= 0 || target == (signed)0xffffffff)) return;
+  
   _desktop = target;
+
+  Openbox::instance->property()->set(_window,
+                                     otk::OBProperty::net_wm_desktop,
+                                     otk::OBProperty::Atom_Cardinal,
+                                     (unsigned)_desktop);
+  
+  
+  // XXX: move the window to the new desktop
 }
 
 
This page took 0.024401 seconds and 4 git commands to generate.