From 2df4d8c7aaaa904cac084e0a41bd2219dc269e42 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 19 Feb 2003 09:35:13 +0000 Subject: [PATCH] map to the highest possible desktop if a desktop too large is requested --- src/client.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client.cc b/src/client.cc index e991639b..2e78cb76 100644 --- a/src/client.cc +++ b/src/client.cc @@ -155,9 +155,11 @@ void Client::getDesktop() if (otk::Property::get(_window, otk::Property::atoms.net_wm_desktop, otk::Property::atoms.cardinal, - (long unsigned*)&d) && - d < openbox->screen(_screen)->numDesktops()) { - _desktop = d; + (long unsigned*)&d)) { + if (d >= openbox->screen(_screen)->numDesktops() && + d != 0xffffffff) + d = openbox->screen(_screen)->numDesktops() - 1; + _desktop = d; #ifdef DEBUG // printf("Window requested desktop: %ld\n", _desktop); #endif -- 2.45.2