From 650768211fbfa3bcde7f7b52c152cc630dbe6404 Mon Sep 17 00:00:00 2001 From: Frederic Laing Date: Fri, 26 Jun 2026 16:08:59 +0200 Subject: [PATCH] fix: keep windows visible until overview commits a buffer --- src/utils/quirks.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/utils/quirks.rs b/src/utils/quirks.rs index 2ecda9fd..e0954fd4 100644 --- a/src/utils/quirks.rs +++ b/src/utils/quirks.rs @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-3.0-only -use smithay::{desktop::layer_map_for_output, output::Output}; +use smithay::{ + backend::renderer::utils::with_renderer_surface_state, desktop::layer_map_for_output, + output::Output, +}; /// Layer shell namespace used by `cosmic-workspaces` // TODO: Avoid special case, or add protocol to expose required behavior @@ -10,5 +13,14 @@ pub const WORKSPACE_OVERVIEW_NAMESPACE: &str = "cosmic-workspace-overview"; pub fn workspace_overview_is_open(output: &Output) -> bool { layer_map_for_output(output) .layers() - .any(|s| s.namespace() == WORKSPACE_OVERVIEW_NAMESPACE) + .filter(|s| s.namespace() == WORKSPACE_OVERVIEW_NAMESPACE) + // Only consider the overview open once it has committed a buffer. The + // surface is inserted into the layer map on its initial (bufferless) + // commit, so checking for the namespace alone hides all toplevels for a + // frame before the overview has anything to draw, briefly flashing the + // bare wallpaper. + .any(|s| { + with_renderer_surface_state(s.wl_surface(), |state| state.buffer().is_some()) + .unwrap_or(false) + }) }