diff --git a/draw.c b/draw.c index 7bcb262d..169e52a5 100644 --- a/draw.c +++ b/draw.c @@ -134,7 +134,7 @@ draw_context_init(draw_context_t *d, d->height = height; d->pixmap = px; d->surface = cairo_xcb_surface_create(globalconf.connection, - px, globalconf.screens.tab[0].visual, + px, globalconf.visual, width, height); d->cr = cairo_create(d->surface); d->layout = pango_cairo_create_layout(d->cr); @@ -307,10 +307,10 @@ draw_rotate(draw_context_t *ctx, cairo_t *cr; surface = cairo_xcb_surface_create(globalconf.connection, dest, - globalconf.screens.tab[0].visual, + globalconf.visual, dest_w, dest_h); source = cairo_xcb_surface_create(globalconf.connection, src, - globalconf.screens.tab[0].visual, + globalconf.visual, src_w, src_h); cr = cairo_create (surface); @@ -344,7 +344,7 @@ draw_text_extents(draw_text_context_t *data) surface = cairo_xcb_surface_create(globalconf.connection, globalconf.default_screen, - globalconf.screens.tab[0].visual, + globalconf.visual, s->width_in_pixels, s->height_in_pixels); diff --git a/font.c b/font.c index f5fcb16b..33608758 100644 --- a/font.c +++ b/font.c @@ -43,7 +43,7 @@ font_new(const char *fontname) * order to get font informations */ surface = cairo_xcb_surface_create(globalconf.connection, globalconf.default_screen, - globalconf.screens.tab[0].visual, 1, 1); + globalconf.visual, 1, 1); cr = cairo_create(surface); layout = pango_cairo_create_layout(cr); diff --git a/globalconf.h b/globalconf.h index f57d59dd..553317c6 100644 --- a/globalconf.h +++ b/globalconf.h @@ -109,6 +109,8 @@ typedef struct } systray; /** The monitor of startup notifications */ SnMonitorContext *snmonitor; + /** The default visual, used to draw */ + xcb_visualtype_t *visual; } awesome_t; extern awesome_t globalconf; diff --git a/screen.c b/screen.c index dffe347e..0674bde2 100644 --- a/screen.c +++ b/screen.c @@ -151,8 +151,6 @@ screen_scan_randr(void) if(globalconf.screens.len > 1) globalconf.xinerama_is_active = true; - globalconf.screens.tab[0].visual = screen_default_visual(xutil_screen_get(globalconf.connection, globalconf.default_screen)); - return true; } } @@ -213,9 +211,6 @@ screen_scan_xinerama(void) p_delete(&xsq); - xcb_screen_t *s = xutil_screen_get(globalconf.connection, globalconf.default_screen); - globalconf.screens.tab[0].visual = screen_default_visual(s); - return true; } @@ -232,7 +227,6 @@ static void screen_scan_x11(void) s.geometry.y = 0; s.geometry.width = xcb_screen->width_in_pixels; s.geometry.height = xcb_screen->height_in_pixels; - s.visual = screen_default_visual(xcb_screen); screen_array_append(&globalconf.screens, s); } @@ -245,6 +239,7 @@ screen_scan(void) screen_scan_x11(); globalconf.screen_focus = globalconf.screens.tab; + globalconf.visual = screen_default_visual(xutil_screen_get(globalconf.connection, globalconf.default_screen)); } /** Return the Xinerama screen number where the coordinates belongs to. diff --git a/screen.h b/screen.h index ed6093e3..81614cbb 100644 --- a/screen.h +++ b/screen.h @@ -38,8 +38,6 @@ struct a_screen client_t *prev_client_focus; /** Focused client */ client_t *client_focus; - /** The default visual, used to draw */ - xcb_visualtype_t *visual; /** The signals emitted by screen objects */ signal_array_t signals; /** True if the banning on this screen needs to be updated */