aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-26 12:44:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-26 12:46:37 +0000
commit02fedfb2fc390d848cfe067895ad4617834416e1 (patch)
tree003a4afddd07a9d7a847681eea6a03fff909beb2
parentinput: temporary code to trigger maximize/minimize (diff)
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.
-rw-r--r--wayland.c12
1 files changed, 11 insertions, 1 deletions
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 = {