aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-20 17:21:05 +0200
committerSimon Ser <contact@emersion.fr>2021-04-20 17:22:06 +0200
commit6327f1b36196d5b6e22be9c9f839f29d5f23f346 (patch)
treefb97a1013eaceb17ddfb140b6af4b5ffc76c43ed /sway
parent730efbc89c40a534f5463b5d872ca856fe7cedc4 (diff)
Avoid creating zero-sized textures for titlebars
Creating a zero-sized wlr_texture is incorrect.
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/container.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 43fe6944..47772b62 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -531,6 +531,10 @@ static void update_title_texture(struct sway_container *con,
cairo_surface_destroy(dummy_surface);
cairo_destroy(c);
+ if (width == 0 || height == 0) {
+ return;
+ }
+
cairo_surface_t *surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, width, height);
cairo_t *cairo = cairo_create(surface);