From 02fedfb2fc390d848cfe067895ad4617834416e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 26 Feb 2020 13:44:05 +0100 Subject: [PATCH] wayland: resize main surface when enabling CSDs runtime When we position CSDs inside the main surface, and CSDs are switched on run-time, we need to force a grid resize, since the actual window content will now be smaller. Alternative solution: call resize with width/height increased, to account for the CSDs. This would increase the window size, but would keep the grid size fixed. --- wayland.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wayland.c b/wayland.c index 89c20745..a3b60d72 100644 --- a/wayland.c +++ b/wayland.c @@ -630,8 +630,18 @@ xdg_toplevel_decoration_configure(void *data, break; } - if (win->is_configured) + if (win->is_configured) { +#if FOOT_CSD_OUTSIDE render_csd(win->term); +#else + /* TODO: we could increase the width/height to account for the + * CSDs. This would increase the window size, but keep the + * grid size fixed */ + struct terminal *term = win->term; + int scale = term->scale; + render_resize_force(term, term->width / scale, term->height / scale); +#endif + } } static const struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener = {