From 94829ae846b258a19748c98c99fc15b13ae6d1bc Mon Sep 17 00:00:00 2001 From: Ilya Lukyanov Date: Fri, 4 Aug 2017 23:18:06 +0300 Subject: [PATCH] Rollback ipc event throttling in swaybar --- include/swaybar/bar.h | 2 -- swaybar/ipc.c | 17 +++-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index 83dd07942..010e1f84c 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h @@ -15,8 +15,6 @@ struct bar { int ipc_socketfd; int status_read_fd; pid_t status_command_pid; - - int pending_ipc_requests; }; struct output { diff --git a/swaybar/ipc.c b/swaybar/ipc.c index 700554781..3481029f7 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -250,25 +250,14 @@ static void ipc_parse_config(struct config *config, const char *payload) { } static void ipc_update_workspaces_request(struct bar *bar) { + sway_log(L_DEBUG, "Sending update request"); + uint32_t len = 0; - - if (bar->pending_ipc_requests >= 10) { - sway_log(L_DEBUG, "Ignoring update request"); - return; - } - bar->pending_ipc_requests++; - sway_log(L_DEBUG, "Sending update request, %d pending", bar->pending_ipc_requests); - ipc_single_command_no_response(bar->ipc_socketfd, IPC_GET_WORKSPACES, NULL, &len); } static void ipc_update_workspaces_response(struct bar *bar, char *res) { - bar->pending_ipc_requests--; - sway_log(L_DEBUG, "Got update response, %d pending", bar->pending_ipc_requests); - if (bar->pending_ipc_requests < 0) { - sway_log(L_DEBUG, "Unexpected update response"); - bar->pending_ipc_requests = 0; - } + sway_log(L_DEBUG, "Got update response"); int i; for (i = 0; i < bar->outputs->length; ++i) {