wayland: always render a new frame after a fullscreen change

This is needed, since we disable alpha in fullscreen, and since we use
different image buffer formats (XRGB vs. ARGB) when we have alpha
vs. when we don't (and fullscreen always disables alpha).

Normally, this happens anyway, as the window is resized when going in
or out from fullscreen. But, it's technically possible for a
compositor to change an application's fullscreen state without
resizing the window.
This commit is contained in:
Daniel Eklöf 2025-10-15 09:41:52 +02:00
parent 96605bf52f
commit dbf18ba444
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 23 additions and 8 deletions

View file

@ -100,6 +100,10 @@
([#2179][2179]).
* One space too much consumed when copying (or pipe:ing) contents with
tabs ([#2194][2194])
* Ensure we render a new frame when changing fullscreen state. Before,
this was automatically done if the window was also resized. But, it
is possible for a compositor to change an application's fullscreen
state without resizing the window.
[2179]: https://codeberg.org/dnkl/foot/issues/2179
[2194]: https://codeberg.org/dnkl/foot/issues/2194

View file

@ -1097,10 +1097,6 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
else if (csd_was_enabled && !enable_csd)
csd_destroy(win);
/* Update opaque region if fullscreen state changed */
if (was_fullscreen != win->is_fullscreen)
wayl_win_alpha_changed(win);
if (enable_csd && new_width > 0 && new_height > 0) {
if (wayl_win_csd_titlebar_visible(win))
new_height -= win->term->conf->csd.title_height;
@ -1139,11 +1135,26 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
else
term_visual_focus_out(term);
if (!resized && !term->render.pending.grid) {
/*
* Update opaque region if fullscreen state changed, also need to
* render, since we use different buffer types with and without
* alpha
*/
if (was_fullscreen != win->is_fullscreen) {
wayl_win_alpha_changed(win);
render_refresh(term);
}
const bool will_render_soon = resized ||
term->render.refresh.grid ||
term->render.pending.grid;
if (!will_render_soon) {
/*
* If we didn't resize, we won't be committing a new surface
* anytime soon. Some compositors require a commit in
* combination with an ack - make them happy.
* If we didn't resize, and aren't refreshing for other
* reasons, we won't be committing a new surface anytime
* soon. Some compositors require a commit in combination with
* an ack - make them happy.
*/
wl_surface_commit(win->surface.surf);
}