]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Delay event-subscription until reconnect (thx aniou)
authorAxel Wagner <mail@merovius.de>
Sun, 31 Jul 2011 16:26:52 +0000 (18:26 +0200)
committerAxel Wagner <mail@merovius.de>
Sun, 31 Jul 2011 16:26:52 +0000 (18:26 +0200)
i3bar/src/ipc.c
i3bar/src/main.c

index 3d2cca5844a0d15de5f503fb077ec203e3a5d2cb..85cd234f98619fb3f942453ad769b2349b721acf 100644 (file)
@@ -44,7 +44,13 @@ void retry_connection(struct ev_loop *loop, ev_timer *w, int events) {
     retries = 8;
     ev_timer_stop(loop, w);
     subscribe_events();
-    reconfig_windows();
+
+    /* We get the current outputs and workspaces, to
+     * reconfigure all bars with the current configuration */
+    i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
+    if (!config.disable_ws) {
+        i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+    }
 }
 
 /*
index d3107bfb071b5c47f198d3acf63a1d6ece4d8195..e91511ef09ded55ba56d5466eea382a4c77c6ab0 100644 (file)
@@ -260,17 +260,17 @@ int main(int argc, char **argv) {
     free_colors(&colors);
 
     init_outputs();
-    init_connection(socket_path);
-
-    /* We subscribe to the i3-events we need */
-    subscribe_events();
-
-    /* We initiate the main-function by requesting infos about the outputs and
-     * workspaces. Everything else (creating the bars, showing the right workspace-
-     * buttons and more) is taken care of by the event-driveniness of the code */
-    i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
-    if (!config.disable_ws) {
-        i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+    if (init_connection(socket_path)) {
+        /* We subscribe to the i3-events we need */
+        subscribe_events();
+
+        /* We initiate the main-function by requesting infos about the outputs and
+         * workspaces. Everything else (creating the bars, showing the right workspace-
+         * buttons and more) is taken care of by the event-driveniness of the code */
+        i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
+        if (!config.disable_ws) {
+            i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
+        }
     }
 
     /* The name of this function is actually misleading. Even if no -c is specified,