i3bar: Allow to force unhide with draw_bars

This commit is contained in:
Quentin Glidic 2012-08-21 13:51:40 +02:00 committed by Michael Stapelberg
parent 8210c6be79
commit 830829922b
4 changed files with 10 additions and 11 deletions

View File

@ -110,7 +110,7 @@ void reconfig_windows(void);
* Render the bars, with buttons and statusline * 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 * Redraw the bars, i.e. simply copy the buffer to the barwindow

View File

@ -172,7 +172,7 @@ static unsigned char *get_buffer(ev_io *watcher, int *ret_buffer_len) {
/* end of file, kill the watcher */ /* end of file, kill the watcher */
ELOG("stdin: received EOF\n"); ELOG("stdin: received EOF\n");
cleanup(); cleanup();
draw_bars(); draw_bars(false);
*ret_buffer_len = -1; *ret_buffer_len = -1;
return NULL; 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); read_flat_input((char*)buffer, rec);
} }
free(buffer); free(buffer);
draw_bars(); draw_bars(false);
} }
/* /*

View File

@ -42,7 +42,7 @@ void got_command_reply(char *reply) {
void got_workspace_reply(char *reply) { void got_workspace_reply(char *reply) {
DLOG("Got Workspace-Data!\n"); DLOG("Got Workspace-Data!\n");
parse_workspaces_json(reply); parse_workspaces_json(reply);
draw_bars(); draw_bars(false);
} }
/* /*
@ -71,7 +71,7 @@ void got_output_reply(char *reply) {
kick_tray_clients(o_walk); kick_tray_clients(o_walk);
} }
draw_bars(); draw_bars(false);
} }
/* /*

View File

@ -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 /* Trigger an update to copy the statusline text to the appropriate
* position */ * position */
configure_trayclients(); 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 */ /* Trigger an update, we now have more space for the statusline */
configure_trayclients(); configure_trayclients();
draw_bars(); draw_bars(false);
return; return;
} }
} }
@ -624,13 +624,13 @@ static void handle_property_notify(xcb_property_notify_event_t *event) {
xcb_unmap_window(xcb_connection, trayclient->win); xcb_unmap_window(xcb_connection, trayclient->win);
trayclient->mapped = map_it; trayclient->mapped = map_it;
configure_trayclients(); configure_trayclients();
draw_bars(); draw_bars(false);
} else if (!trayclient->mapped && map_it) { } else if (!trayclient->mapped && map_it) {
/* need to map the window */ /* need to map the window */
xcb_map_window(xcb_connection, trayclient->win); xcb_map_window(xcb_connection, trayclient->win);
trayclient->mapped = map_it; trayclient->mapped = map_it;
configure_trayclients(); configure_trayclients();
draw_bars(); draw_bars(false);
} }
free(xembedr); free(xembedr);
} }
@ -1398,14 +1398,13 @@ void reconfig_windows(void) {
* Render the bars, with buttons and statusline * Render the bars, with buttons and statusline
* *
*/ */
void draw_bars(void) { void draw_bars(bool unhide) {
DLOG("Drawing Bars...\n"); DLOG("Drawing Bars...\n");
int i = 0; int i = 0;
refresh_statusline(); refresh_statusline();
static char *last_urgent_ws = NULL; static char *last_urgent_ws = NULL;
bool unhide = false;
bool walks_away = true; bool walks_away = true;
i3_output *outputs_walk; i3_output *outputs_walk;