aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-01 12:17:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-01 12:17:54 +0000
commit875b067f136f05c04db56be9d9de69b3391832c8 (patch)
tree589640005774636d00bc603a29b38fb8dc851e5f /render.c
parentterm: visual_focus_{in,out}: use quirk_weston_subsurface_desync_{on,off} (diff)
render: csd: don't try to render a zero-width/height border
Diffstat (limited to 'render.c')
-rw-r--r--render.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/render.c b/render.c
index df8a98de..740d3e55 100644
--- a/render.c
+++ b/render.c
@@ -743,6 +743,8 @@ render_csd_title(struct terminal *term)
struct csd_data info = get_csd_data(term, CSD_SURF_TITLE);
struct wl_surface *surf = term->window->csd.surface[CSD_SURF_TITLE];
+ assert(info.width > 0 && info.height > 0);
+
unsigned long cookie = shm_cookie_csd(term, CSD_SURF_TITLE);
struct buffer *buf = shm_get_buffer(
term->wl->shm, info.width, info.height, cookie);
@@ -773,6 +775,9 @@ render_csd_border(struct terminal *term, enum csd_surface surf_idx)
struct csd_data info = get_csd_data(term, surf_idx);
struct wl_surface *surf = term->window->csd.surface[surf_idx];
+ if (info.width == 0 || info.height == 0)
+ return;
+
unsigned long cookie = shm_cookie_csd(term, surf_idx);
struct buffer *buf = shm_get_buffer(
term->wl->shm, info.width, info.height, cookie);