]> Dogcows Code - chaz/openbox/blobdiff - src/blackbox.cc
change to match blackbox
[chaz/openbox] / src / blackbox.cc
index ce727aff42354a5c62b2916513b9589bf37c992a..56782248dddd5b9a3ef6802df26ef17e8f20cd0c 100644 (file)
@@ -90,6 +90,8 @@ extern "C" {
 #endif // HAVE_LIBGEN_H
 }
 
+#include <assert.h>
+
 #include <algorithm>
 #include <string>
 using std::string;
@@ -664,10 +666,9 @@ void Blackbox::process_event(XEvent *e) {
       } else if(e->xclient.message_type == getBlackboxChangeWorkspaceAtom()) {
         BScreen *screen = searchScreen(e->xclient.window);
 
-        if (screen && e->xclient.data.l[0] >= 0 &&
-            e->xclient.data.l[0] <
-            static_cast<signed>(screen->getWorkspaceCount()))
-          screen->changeWorkspaceID(e->xclient.data.l[0]);
+        unsigned int workspace = e->xclient.data.l[0];
+        if (screen && workspace < screen->getWorkspaceCount())
+          screen->changeWorkspaceID(workspace);
       } else if (e->xclient.message_type == getBlackboxChangeWindowFocusAtom()) {
         BlackboxWindow *win = searchWindow(e->xclient.window);
 
This page took 0.020525 seconds and 4 git commands to generate.