introduce client.placeholder color

This commit is contained in:
Michael Stapelberg 2013-12-15 11:42:40 +01:00
parent 639a1b182c
commit 35b70ca423
4 changed files with 12 additions and 5 deletions

View File

@ -727,6 +727,9 @@ client.unfocused::
A client which is not the focused one of its container. A client which is not the focused one of its container.
client.urgent:: client.urgent::
A client which has its urgency hint activated. A client which has its urgency hint activated.
client.placeholder::
Background and text color are used to draw placeholder window contents
(when restoring layouts). Border and indicator are ignored.
You can also specify the color to be used to paint the background of the client You can also specify the color to be used to paint the background of the client
windows. This color will be used to paint the window on top of which the client windows. This color will be used to paint the window on top of which the client
@ -749,6 +752,7 @@ client.focused #4c7899 #285577 #ffffff #2e9ef4
client.focused_inactive #333333 #5f676a #ffffff #484e50 client.focused_inactive #333333 #5f676a #ffffff #484e50
client.unfocused #333333 #222222 #888888 #292d2e client.unfocused #333333 #222222 #888888 #292d2e
client.urgent #2f343a #900000 #ffffff #900000 client.urgent #2f343a #900000 #ffffff #900000
client.placeholder #000000 #0c0c0c #ffffff #000000
--------------------------------------------------------- ---------------------------------------------------------
Note that for the window decorations, the color around the child window is the Note that for the window decorations, the color around the child window is the

View File

@ -180,6 +180,7 @@ struct Config {
struct Colortriple focused_inactive; struct Colortriple focused_inactive;
struct Colortriple unfocused; struct Colortriple unfocused;
struct Colortriple urgent; struct Colortriple urgent;
struct Colortriple placeholder;
} client; } client;
struct config_bar { struct config_bar {
struct Colortriple focused; struct Colortriple focused;

View File

@ -456,6 +456,9 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
INIT_COLOR(config.client.unfocused, "#333333", "#222222", "#888888", "#292d2e"); INIT_COLOR(config.client.unfocused, "#333333", "#222222", "#888888", "#292d2e");
INIT_COLOR(config.client.urgent, "#2f343a", "#900000", "#ffffff", "#900000"); INIT_COLOR(config.client.urgent, "#2f343a", "#900000", "#ffffff", "#900000");
/* border and indicator color are ignored for placeholder contents */
INIT_COLOR(config.client.placeholder, "#000000", "#0c0c0c", "#ffffff", "#000000");
/* the last argument (indicator color) is ignored for bar colors */ /* the last argument (indicator color) is ignored for bar colors */
INIT_COLOR(config.bar.focused, "#4c7899", "#285577", "#ffffff", "#000000"); INIT_COLOR(config.bar.focused, "#4c7899", "#285577", "#ffffff", "#000000");
INIT_COLOR(config.bar.unfocused, "#333333", "#222222", "#888888", "#000000"); INIT_COLOR(config.bar.unfocused, "#333333", "#222222", "#888888", "#000000");

View File

@ -100,8 +100,8 @@ void restore_connect(void) {
} }
static void update_placeholder_contents(placeholder_state *state) { static void update_placeholder_contents(placeholder_state *state) {
// TODO: introduce color configuration for placeholder windows. xcb_change_gc(restore_conn, state->gc, XCB_GC_FOREGROUND,
xcb_change_gc(restore_conn, state->gc, XCB_GC_FOREGROUND, (uint32_t[]) { config.client.background }); (uint32_t[]) { config.client.placeholder.background });
xcb_poly_fill_rectangle(restore_conn, state->pixmap, state->gc, 1, xcb_poly_fill_rectangle(restore_conn, state->pixmap, state->gc, 1,
(xcb_rectangle_t[]) { { 0, 0, state->rect.width, state->rect.height } }); (xcb_rectangle_t[]) { { 0, 0, state->rect.width, state->rect.height } });
@ -109,7 +109,7 @@ static void update_placeholder_contents(placeholder_state *state) {
xcb_flush(restore_conn); xcb_flush(restore_conn);
xcb_aux_sync(restore_conn); xcb_aux_sync(restore_conn);
set_font_colors(state->gc, config.client.focused.background, 0); set_font_colors(state->gc, config.client.placeholder.text, config.client.placeholder.background);
Match *swallows; Match *swallows;
int n = 0; int n = 0;
@ -168,8 +168,7 @@ static void open_placeholder_window(Con *con) {
true, true,
XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK,
(uint32_t[]){ (uint32_t[]){
// TODO: use the background color as background pixel to avoid flickering config.client.placeholder.background,
root_screen->white_pixel,
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY, XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY,
}); });
/* Set the same name as was stored in the layout file. While perhaps /* Set the same name as was stored in the layout file. While perhaps