diff options
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 6e5ba4fd..d72fc5db 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -852,15 +852,16 @@ json_object *ipc_json_describe_bar_config(struct bar_config *bar) { | |||
852 | } | 852 | } |
853 | 853 | ||
854 | json_object *tray_bindings = json_object_new_array(); | 854 | json_object *tray_bindings = json_object_new_array(); |
855 | for (int i = 0; i < 10; ++i) { | 855 | struct tray_binding *tray_bind = NULL; |
856 | if (bar->tray_bindings[i]) { | 856 | wl_list_for_each(tray_bind, &bar->tray_bindings, link) { |
857 | json_object *bind = json_object_new_object(); | 857 | json_object *bind = json_object_new_object(); |
858 | json_object_object_add(bind, "input_code", | 858 | json_object_object_add(bind, "input_code", |
859 | json_object_new_int(i)); | 859 | json_object_new_int(event_to_x11_button(tray_bind->button))); |
860 | json_object_object_add(bind, "command", | 860 | json_object_object_add(bind, "event_code", |
861 | json_object_new_string(bar->tray_bindings[i])); | 861 | json_object_new_int(tray_bind->button)); |
862 | json_object_array_add(tray_bindings, bind); | 862 | json_object_object_add(bind, "command", |
863 | } | 863 | json_object_new_string(tray_bind->command)); |
864 | json_object_array_add(tray_bindings, bind); | ||
864 | } | 865 | } |
865 | if (json_object_array_length(tray_bindings) > 0) { | 866 | if (json_object_array_length(tray_bindings) > 0) { |
866 | json_object_object_add(json, "tray_bindings", tray_bindings); | 867 | json_object_object_add(json, "tray_bindings", tray_bindings); |