Avoid creating zero-sized textures for titlebars

Creating a zero-sized wlr_texture is incorrect.

(cherry picked from commit 6327f1b361)
This commit is contained in:
Simon Ser 2021-04-20 17:21:05 +02:00
parent 599874a158
commit 7d6b23a0be

View file

@ -531,6 +531,10 @@ static void update_title_texture(struct sway_container *con,
cairo_surface_destroy(dummy_surface); cairo_surface_destroy(dummy_surface);
cairo_destroy(c); cairo_destroy(c);
if (width == 0 || height == 0) {
return;
}
cairo_surface_t *surface = cairo_image_surface_create( cairo_surface_t *surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, width, height); CAIRO_FORMAT_ARGB32, width, height);
cairo_t *cairo = cairo_create(surface); cairo_t *cairo = cairo_create(surface);