summaryrefslogtreecommitdiff
path: root/openbox/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/event.c')
-rw-r--r--openbox/event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 6560402f..69b63ff1 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -485,7 +485,9 @@ static void event_handle_client(Client *client, XEvent *e)
}
e->xclient = ce.xclient;
}
- client_set_desktop(client, e->xclient.data.l[0]);
+ if (e->xclient.data.l[0] >= 0 &&
+ e->xclient.data.l[0] < screen_num_desktops)
+ client_set_desktop(client, e->xclient.data.l[0]);
} else if (msgtype == prop_atoms.net_wm_state) {
/* can't compress these */
g_message("net_wm_state %s %ld %ld for 0x%lx",