Use scissor to render title texture

This allows the title's texture to always be the full width of the text,
and clipped at render time according to the desired width (eg. tabs...).

As an added bonus, the texture no longer needs to be updated when
containers are arranged.
This commit is contained in:
Ryan Dwyer 2018-05-05 20:32:31 +10:00
parent fbcbbb976c
commit e83e5487be
3 changed files with 3 additions and 12 deletions

View file

@ -584,12 +584,6 @@ static void update_title_texture(struct sway_container *con,
get_text_size(c, config->font, &width, NULL, scale, false, "%s", con->name);
cairo_destroy(c);
int borders = (con->type == C_VIEW ? con->sway_view->border_thickness :
config->border_thickness) * 2 * scale;
if (width > con->width * scale - borders) {
width = con->width * scale - borders;
}
cairo_surface_t *surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, width, height);
cairo_t *cairo = cairo_create(surface);