aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-10-15 07:41:52 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-10-15 07:41:52 +0000
commitdbf18ba444e728ecddcc0e15fc44cc1fc0590b53 (patch)
tree5c9dd93a6016a9b8355370f48b910f479be9eaee /wayland.c
parentextract: number of spaces after the tab shouldn't include the tab cell itself (diff)
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.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/wayland.c b/wayland.c
index 59b2a33e..bac087fb 100644
--- a/wayland.c
+++ b/wayland.c
@@ -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);
}