mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
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:
parent
d863ea8a46
commit
02fedfb2fc
1 changed files with 11 additions and 1 deletions
12
wayland.c
12
wayland.c
|
|
@ -630,8 +630,18 @@ xdg_toplevel_decoration_configure(void *data,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (win->is_configured)
|
if (win->is_configured) {
|
||||||
|
#if FOOT_CSD_OUTSIDE
|
||||||
render_csd(win->term);
|
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 = {
|
static const struct zxdg_toplevel_decoration_v1_listener xdg_toplevel_decoration_listener = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue