X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=c3ab3c63a8740f25f677c38aa7c977fae1195b9b;hb=7175ac2b5aec7aface6a2f86df32dd0386e0cc05;hp=298e5f56a64f90b4296bebd070a26730f60d3c6f;hpb=3d8ffcc2cb23901e492426f0249bdc5504c2f642;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 298e5f56..c3ab3c63 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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); + } } @@ -653,8 +659,17 @@ void OBClient::setDesktop(long 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 }