]> Dogcows Code - chaz/openbox/commitdiff
only map on a requested desktop if its not out of range
authorDana Jansens <danakj@orodu.net>
Wed, 19 Feb 2003 09:33:30 +0000 (09:33 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 19 Feb 2003 09:33:30 +0000 (09:33 +0000)
src/client.cc

index 9e3cdae195cb2dac77f9476b5c2dbd7303226813..e991639bb8d92db4e1dd4c1c647856cf9a136831 100644 (file)
@@ -151,10 +151,13 @@ void Client::getDesktop()
 {
   // defaults to the current desktop
   _desktop = openbox->screen(_screen)->desktop();
+  unsigned int d;
 
   if (otk::Property::get(_window, otk::Property::atoms.net_wm_desktop,
                          otk::Property::atoms.cardinal,
-                         (long unsigned*)&_desktop)) {
+                         (long unsigned*)&d) &&
+      d < openbox->screen(_screen)->numDesktops()) {
+      _desktop = d;
 #ifdef DEBUG
 //    printf("Window requested desktop: %ld\n", _desktop);
 #endif
This page took 0.02832 seconds and 4 git commands to generate.