Use 32-bit visuals for i3bar when possible and allow RGBA colors.
This patch creates all necessary windows for i3bar with 32-bit visuals if available. It also introduces the possibility to define RGBA colors (next to RGB colors), which allows the user to set the opacity of any color. This requires running a compositor. With this patch we also start supporting _NET_SYSTEM_TRAY_VISUAL, which is necessary for the tray icons so they create the tray window with the correct depth and visual.
This commit is contained in:
@ -161,7 +161,7 @@ static void update_placeholder_contents(placeholder_state *state) {
|
||||
DLOG("con %p (placeholder 0x%08x) line %d: %s\n", state->con, state->window, n, serialized);
|
||||
|
||||
i3String *str = i3string_from_utf8(serialized);
|
||||
draw_text(str, state->pixmap, state->gc, 2, (n * (config.font.height + 2)) + 2, state->rect.width - 2);
|
||||
draw_text(str, state->pixmap, state->gc, NULL, 2, (n * (config.font.height + 2)) + 2, state->rect.width - 2);
|
||||
i3string_free(str);
|
||||
n++;
|
||||
free(serialized);
|
||||
@ -172,7 +172,7 @@ static void update_placeholder_contents(placeholder_state *state) {
|
||||
int text_width = predict_text_width(line);
|
||||
int x = (state->rect.width / 2) - (text_width / 2);
|
||||
int y = (state->rect.height / 2) - (config.font.height / 2);
|
||||
draw_text(line, state->pixmap, state->gc, x, y, text_width);
|
||||
draw_text(line, state->pixmap, state->gc, NULL, x, y, text_width);
|
||||
i3string_free(line);
|
||||
xcb_flush(conn);
|
||||
xcb_aux_sync(conn);
|
||||
|
@ -154,7 +154,7 @@ static int sig_draw_window(xcb_window_t win, int width, int height, int font_hei
|
||||
if (i == backtrace_string_index)
|
||||
set_font_colors(pixmap_gc, get_colorpixel(bt_colour), get_colorpixel("#000000"));
|
||||
|
||||
draw_text(crash_text_i3strings[i], pixmap, pixmap_gc,
|
||||
draw_text(crash_text_i3strings[i], pixmap, pixmap_gc, NULL,
|
||||
8, 5 + i * font_height, width - 16);
|
||||
|
||||
/* and reset the colour again for other lines */
|
||||
|
4
src/x.c
4
src/x.c
@ -552,7 +552,7 @@ void x_draw_decoration(Con *con) {
|
||||
FREE(formatted_mark);
|
||||
mark_width = predict_text_width(mark);
|
||||
|
||||
draw_text(mark, parent->pixmap, parent->pm_gc,
|
||||
draw_text(mark, parent->pixmap, parent->pm_gc, NULL,
|
||||
con->deco_rect.x + con->deco_rect.width - mark_width - logical_px(2),
|
||||
con->deco_rect.y + text_offset_y, mark_width);
|
||||
|
||||
@ -561,7 +561,7 @@ void x_draw_decoration(Con *con) {
|
||||
|
||||
i3String *title = win->title_format == NULL ? win->name : window_parse_title_format(win);
|
||||
draw_text(title,
|
||||
parent->pixmap, parent->pm_gc,
|
||||
parent->pixmap, parent->pm_gc, NULL,
|
||||
con->deco_rect.x + logical_px(2) + indent_px, con->deco_rect.y + text_offset_y,
|
||||
con->deco_rect.width - logical_px(2) - indent_px - mark_width - logical_px(2));
|
||||
if (win->title_format != NULL)
|
||||
|
Reference in New Issue
Block a user