summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-06-26 07:30:19 +0000
committerDana Jansens <danakj@orodu.net>2003-06-26 07:30:19 +0000
commitda24f9156bdd4758fa803c73769d3dec0c5d2895 (patch)
tree37f4d974c8a968603302a9be9cb7cd62732298d5
parent0423b057ed754abca28033cc5f0621e8266c34db (diff)
set the desktop hint when the window already has a hint but its out of range
-rw-r--r--openbox/client.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 9d19cfa5..08c22a75 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -587,12 +587,13 @@ static void client_get_area(Client *self)
static void client_get_desktop(Client *self)
{
- guint32 d;
+ guint32 d = screen_num_desktops; /* an always-invalid value */
if (PROP_GET32(self->window, net_wm_desktop, cardinal, &d)) {
if (d >= screen_num_desktops && d != DESKTOP_ALL)
- d = screen_num_desktops - 1;
- self->desktop = d;
+ self->desktop = screen_num_desktops - 1;
+ else
+ self->desktop = d;
} else {
gboolean trdesk = FALSE;
@@ -616,6 +617,8 @@ static void client_get_desktop(Client *self)
/* defaults to the current desktop */
self->desktop = screen_desktop;
+ }
+ if (self->desktop != d) {
/* set the desktop hint, to make sure that it always exists */
PROP_SET32(self->window, net_wm_desktop, cardinal, self->desktop);
}