mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
module/i3: add a 'burst_done()' callback
This callback is called after all received packets have been processed, before going into a blocking poll() again.
This commit is contained in:
parent
5e97c77c24
commit
f9044ec883
2 changed files with 5 additions and 0 deletions
|
@ -298,6 +298,9 @@ i3_receive_loop(int abort_fd, int sock,
|
||||||
memmove(buf, &buf[total_size], buf_idx - total_size);
|
memmove(buf, &buf[total_size], buf_idx - total_size);
|
||||||
buf_idx -= total_size;
|
buf_idx -= total_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cbs->burst_done != NULL)
|
||||||
|
cbs->burst_done(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
|
@ -15,6 +15,8 @@ bool i3_send_pkg(int sock, int cmd, char *data);
|
||||||
typedef bool (*i3_ipc_callback_t)(int type, const struct json_object *json, void *data);
|
typedef bool (*i3_ipc_callback_t)(int type, const struct json_object *json, void *data);
|
||||||
|
|
||||||
struct i3_ipc_callbacks {
|
struct i3_ipc_callbacks {
|
||||||
|
void (*burst_done)(void *data);
|
||||||
|
|
||||||
i3_ipc_callback_t reply_command;
|
i3_ipc_callback_t reply_command;
|
||||||
i3_ipc_callback_t reply_workspaces;
|
i3_ipc_callback_t reply_workspaces;
|
||||||
i3_ipc_callback_t reply_subscribe;
|
i3_ipc_callback_t reply_subscribe;
|
||||||
|
|
Loading…
Add table
Reference in a new issue