From 4f93e0587a849de00a1f50bfcd48a549009178c0 Mon Sep 17 00:00:00 2001 From: TunnelWicht Date: Tue, 1 May 2012 13:35:34 +0200 Subject: [PATCH] =?utf8?q?don=E2=80=99t=20wrap=20when=20changing=20workspa?= =?utf8?q?ces=20by=20mouse=20wheel=20scrolling?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- i3bar/src/xcb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 87926d33..205c08cc 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -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; -- 2.39.5