From fb1c1a81632bcf79be2808373941700b51a1d8ee Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 19 Feb 2003 09:33:30 +0000 Subject: [PATCH] only map on a requested desktop if its not out of range --- src/client.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client.cc b/src/client.cc index 9e3cdae1..e991639b 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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 -- 2.45.2