From 23ba9b5cae640cf10a34e9c1a35864f31e3a0817 Mon Sep 17 00:00:00 2001 From: Wanjohi Date: Thu, 15 Oct 2026 10:03:44 +0300 Subject: [PATCH] fix(nescope): send frame callbacks to Xwayland windows Since frame callbacks moved onto the commit path, the commit handler found a window by its xdg toplevel. An Xwayland window has none, so no Proton game got a frame callback or presentation feedback. Xwayland then completes a flip only on its one-second fallback timer, and a game presenting FIFO stalls in the driver after its first frame. --- apps/nescope/src/handlers.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/nescope/src/handlers.rs b/apps/nescope/src/handlers.rs index 2a0d341e..7d4cdcf6 100644 --- a/apps/nescope/src/handlers.rs +++ b/apps/nescope/src/handlers.rs @@ -100,14 +100,14 @@ impl CompositorHandler for NescopeState { s }; + // Matched on the window's surface, not its xdg toplevel: an Xwayland + // window has no toplevel, and matching on one left every Proton game + // without frame callbacks. Xwayland then completes a flip only on its + // one-second fallback timer, and a game presenting FIFO stalls. let Some(window) = self .space .elements() - .find(|w| { - w.toplevel() - .map(|t| t.wl_surface() == &root) - .unwrap_or(false) - }) + .find(|w| w.wl_surface().is_some_and(|s| *s == root)) .cloned() else { return;