From: Quentin Glidic Date: Tue, 21 Aug 2012 11:51:40 +0000 (+0200) Subject: i3bar: Allow to force unhide with draw_bars X-Git-Tag: 4.4~127 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=830829922b1f2c47f4c7d7065ee58162bed14c93;p=i3%2Fi3 i3bar: Allow to force unhide with draw_bars --- diff --git a/i3bar/include/xcb.h b/i3bar/include/xcb.h index 6c7bc567..dcc4d781 100644 --- a/i3bar/include/xcb.h +++ b/i3bar/include/xcb.h @@ -110,7 +110,7 @@ void reconfig_windows(void); * Render the bars, with buttons and statusline * */ -void draw_bars(void); +void draw_bars(bool force_unhide); /* * Redraw the bars, i.e. simply copy the buffer to the barwindow diff --git a/i3bar/src/child.c b/i3bar/src/child.c index e4c0f357..d6e74176 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -172,7 +172,7 @@ static unsigned char *get_buffer(ev_io *watcher, int *ret_buffer_len) { /* end of file, kill the watcher */ ELOG("stdin: received EOF\n"); cleanup(); - draw_bars(); + draw_bars(false); *ret_buffer_len = -1; return NULL; } @@ -231,7 +231,7 @@ void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) { read_flat_input((char*)buffer, rec); } free(buffer); - draw_bars(); + draw_bars(false); } /* diff --git a/i3bar/src/ipc.c b/i3bar/src/ipc.c index 2cc80cf7..fc8c6492 100644 --- a/i3bar/src/ipc.c +++ b/i3bar/src/ipc.c @@ -42,7 +42,7 @@ void got_command_reply(char *reply) { void got_workspace_reply(char *reply) { DLOG("Got Workspace-Data!\n"); parse_workspaces_json(reply); - draw_bars(); + draw_bars(false); } /* @@ -71,7 +71,7 @@ void got_output_reply(char *reply) { kick_tray_clients(o_walk); } - draw_bars(); + draw_bars(false); } /* diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index aedf6392..405eefdb 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -531,7 +531,7 @@ static void handle_client_message(xcb_client_message_event_t* event) { /* Trigger an update to copy the statusline text to the appropriate * position */ configure_trayclients(); - draw_bars(); + draw_bars(false); } } } @@ -559,7 +559,7 @@ static void handle_unmap_notify(xcb_unmap_notify_event_t* event) { /* Trigger an update, we now have more space for the statusline */ configure_trayclients(); - draw_bars(); + draw_bars(false); return; } } @@ -624,13 +624,13 @@ static void handle_property_notify(xcb_property_notify_event_t *event) { xcb_unmap_window(xcb_connection, trayclient->win); trayclient->mapped = map_it; configure_trayclients(); - draw_bars(); + draw_bars(false); } else if (!trayclient->mapped && map_it) { /* need to map the window */ xcb_map_window(xcb_connection, trayclient->win); trayclient->mapped = map_it; configure_trayclients(); - draw_bars(); + draw_bars(false); } free(xembedr); } @@ -1398,14 +1398,13 @@ void reconfig_windows(void) { * Render the bars, with buttons and statusline * */ -void draw_bars(void) { +void draw_bars(bool unhide) { DLOG("Drawing Bars...\n"); int i = 0; refresh_statusline(); static char *last_urgent_ws = NULL; - bool unhide = false; bool walks_away = true; i3_output *outputs_walk;