Bugfix: Delay event-subscription until reconnect (thx aniou)

This commit is contained in:
Axel Wagner 2011-07-31 18:26:52 +02:00
parent 8d09ed7bf5
commit 3302b22f71
2 changed files with 17 additions and 11 deletions

View File

@ -44,7 +44,13 @@ void retry_connection(struct ev_loop *loop, ev_timer *w, int events) {
retries = 8; retries = 8;
ev_timer_stop(loop, w); ev_timer_stop(loop, w);
subscribe_events(); 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);
}
} }
/* /*

View File

@ -260,17 +260,17 @@ int main(int argc, char **argv) {
free_colors(&colors); free_colors(&colors);
init_outputs(); init_outputs();
init_connection(socket_path); if (init_connection(socket_path)) {
/* We subscribe to the i3-events we need */
subscribe_events();
/* We subscribe to the i3-events we need */ /* We initiate the main-function by requesting infos about the outputs and
subscribe_events(); * workspaces. Everything else (creating the bars, showing the right workspace-
* buttons and more) is taken care of by the event-driveniness of the code */
/* We initiate the main-function by requesting infos about the outputs and i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_OUTPUTS, NULL);
* workspaces. Everything else (creating the bars, showing the right workspace- if (!config.disable_ws) {
* buttons and more) is taken care of by the event-driveniness of the code */ i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
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, /* The name of this function is actually misleading. Even if no -c is specified,