From 9667308e6def22e9b1fa352357a788749ad92c74 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:07:00 +0200 Subject: Fix stale ghost content after window move/resize/close on real hardware The udev backend's damage tracking only forced a full repaint (ages = [0, 0]) on a workspace switch or a VT-switch resume. An ordinary move/resize/open/close/restack within the same workspace relied entirely on OutputDamageTracker's own per-element diffing to compute correct damage for the region a window vacated - which doesn't always hold: maximizing a window over a second one, then un-maximizing, left a persistent ghost of the second window's old titlebar/status text sitting in the vacated corner, unchanged across multiple otherwise- idle frames. render_udev_frame now also hashes every visible window's id and rect each frame and forces the same full-repaint reset whenever that signature changes - the same "defensive, not a fix for a proven bug in the diffing itself" reasoning the existing workspace-switch reset already uses, just triggered by a second, complementary condition. --- crates/wayland/src/udev/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/wayland/src/udev/mod.rs') diff --git a/crates/wayland/src/udev/mod.rs b/crates/wayland/src/udev/mod.rs index 83ffa87..4762992 100644 --- a/crates/wayland/src/udev/mod.rs +++ b/crates/wayland/src/udev/mod.rs @@ -231,6 +231,13 @@ pub(crate) struct UdevState { /// regardless (every head starts with `ages: [0, 0]` - see /// `UdevHead`'s own field). pub(crate) last_rendered_workspace: Option, + /// Order-sensitive hash of every visible window's id and rect, compared + /// each frame in `render_udev_frame` to force `ages` back to `[0, 0]` + /// on any move/resize/open/close/restack - see that comparison's own + /// doc comment for the live-reproduced ghost-content bug this catches. + /// `None` before the first frame, same reasoning as `last_rendered_ + /// workspace` above (renders fully regardless). + pub(crate) last_rendered_layout: Option, } impl UdevState { -- cgit v1.2.3