Add new subscribe event 'mode' for binding mode changes

Introducing a new event to subscribe called mode. It's fired up
when i3 changes binding mode (like switching from default to resize).
IPC guide adjusted also.
This commit is contained in:
Pavel Löbl
2012-09-22 00:21:39 +02:00
committed by Michael Stapelberg
parent 8c8fce82e5
commit 7cffd79140
3 changed files with 24 additions and 0 deletions

View File

@ -194,6 +194,13 @@ void switch_mode(const char *new_mode) {
bindings = mode->bindings;
translate_keysyms();
grab_all_keys(conn, false);
char *event_msg;
sasprintf(&event_msg, "{\"change\":\"%s\"}", mode->name);
ipc_send_event("mode", I3_IPC_EVENT_MODE, event_msg);
FREE(event_msg);
return;
}