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.
This commit is contained in:
Daniel Eklöf 2020-02-26 13:44:05 +01:00
parent d863ea8a46
commit 02fedfb2fc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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 = {