aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-10-25 14:07:44 +0100
committerIan Fan <ianfan0@gmail.com>2018-10-25 14:12:26 +0100
commit19421373b9837860115f1fcf70f160f9d716aee1 (patch)
tree975380b19e47a6490b3c2a905fed417c754704cc
parentc5541763c0c101944473a4cf7dd9b59e1dd04e0b (diff)
swaybar: when scrolling, check that there are workspaces to scroll on
-rw-r--r--swaybar/input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/swaybar/input.c b/swaybar/input.c
index 4aefc6d6..263d0253 100644
--- a/swaybar/input.c
+++ b/swaybar/input.c
@@ -180,6 +180,10 @@ static void wl_pointer_axis(void *data, struct wl_pointer *wl_pointer,
return;
}
+ if (!sway_assert(!wl_list_empty(&output->workspaces), "axis with no workspaces")) {
+ return;
+ }
+
struct swaybar_workspace *first =
wl_container_of(output->workspaces.next, first, link);
struct swaybar_workspace *last =