]> git.sur5r.net Git - i3/i3/commitdiff
don’t wrap when changing workspaces by mouse wheel scrolling
authorTunnelWicht <MilkFreeze@web.de>
Tue, 1 May 2012 11:35:34 +0000 (13:35 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 9 May 2012 18:16:02 +0000 (20:16 +0200)
i3bar/src/xcb.c

index 87926d33bbf400f2d3432a06684827a6e5a4b159..205c08cca342691de8fdaea0280166d4f382d57c 100644 (file)
@@ -302,17 +302,13 @@ void handle_button(xcb_button_press_event_t *event) {
             break;
         case 4:
             /* Mouse wheel down. We select the next ws */
-            if (cur_ws == TAILQ_FIRST(walk->workspaces)) {
-                cur_ws = TAILQ_LAST(walk->workspaces, ws_head);
-            } else {
+            if (cur_ws != TAILQ_FIRST(walk->workspaces)) {
                 cur_ws = TAILQ_PREV(cur_ws, ws_head, tailq);
             }
             break;
         case 5:
             /* Mouse wheel up. We select the previos ws */
-            if (cur_ws == TAILQ_LAST(walk->workspaces, ws_head)) {
-                cur_ws = TAILQ_FIRST(walk->workspaces);
-            } else {
+            if (cur_ws != TAILQ_LAST(walk->workspaces, ws_head)) {
                 cur_ws = TAILQ_NEXT(cur_ws, tailq);
             }
             break;