aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordb <github@benedik.si>2018-04-10 22:01:22 +0200
committerdb <github@benedik.si>2018-04-10 22:01:22 +0200
commit39e33193940d008310341beb44697c4c61ef5752 (patch)
treec6277bad5fe3cf71c7c52d58dc769e9a4c2a0512
parent4240ede065c05df05504c820f397259c7fddc9a8 (diff)
fix swaybar ipc handling
Swap return with break in IPC_EVENT_WORKSPACE case to free resp. Change default return value to true. This causes IPC_EVENT_MODE changes to be rendered instantly.
-rw-r--r--swaybar/ipc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index e6231bd2..ed5d9a31 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -331,7 +331,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
switch (resp->type) {
case IPC_EVENT_WORKSPACE:
ipc_get_workspaces(bar);
- return true;
+ break;
case IPC_EVENT_MODE: {
json_object *result = json_tokener_parse(resp->payload);
if (!result) {
@@ -367,5 +367,5 @@ bool handle_ipc_readable(struct swaybar *bar) {
return false;
}
free_ipc_response(resp);
- return false;
+ return true;
}