]> git.sur5r.net Git - i3/i3/blobdiff - src/ipc.c
Implement i3's logic for maintaining a list of 'bindsym' directives and passing it...
[i3/i3] / src / ipc.c
index ae213b3aa906ff80f3ae6bc500493bbd3acc1ac5..fa02883401015533832637789da5a51b07e9347e 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -469,6 +469,19 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
     y(map_close);
 }
 
+static void dump_mouse_commands(yajl_gen gen, Barconfig *config) {
+    ystr("mouse_commands");
+    y(map_open);
+
+    struct Mousecommand *current;
+    TAILQ_FOREACH(current, &(config->mouse_commands), commands) {
+        ystr(current->button);
+        ystr(current->command);
+    }
+
+    y(map_close);
+}
+
 static void dump_bar_config(yajl_gen gen, Barconfig *config) {
     y(map_open);
 
@@ -549,15 +562,7 @@ static void dump_bar_config(yajl_gen gen, Barconfig *config) {
             break;
     }
 
-    if (config->wheel_up_cmd) {
-        ystr("wheel_up_cmd");
-        ystr(config->wheel_up_cmd);
-    }
-
-    if (config->wheel_down_cmd) {
-        ystr("wheel_down_cmd");
-        ystr(config->wheel_down_cmd);
-    }
+    dump_mouse_commands(gen, config);
 
     ystr("position");
     if (config->position == P_BOTTOM)