From 393f886eb9e275c3b7a9e3ef396092ba71297dfb Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Wed, 3 Dec 2025 22:52:00 +0200 Subject: Stop giving tiled windows a shadow that lands on their neighbour Diagnosed by a peer session (dotfiles-1a): SHADOW_SIZE is 24px, and a tiling layout with a small gap_inner (as little as 1px live) leaves the shadow nowhere to fall except onto the adjacent tile, darkening it by up to SHADOW_MAX_ALPHA (~35%) on whichever side is unfocused. Not a content tint or an opacity rule - verified against the actual rasteriser and the live rule set before accepting the diagnosis. A drop shadow separates a window from what's behind it; tiled windows are coplanar and adjacent by construction, with nothing behind them to separate from. redraw_decoration_buffer's shadow gate now requires w.floating in addition to the existing !maximized/!fullscreen checks. DecorationSignature gained a floating field so toggling floating on its own invalidates the decoration cache instead of waiting for an unrelated field to force a rebuild. Live-verified in a nested compositor: two tiled windows show a clean shared edge with no gradient bleeding across; floating a window still detaches it from the tile group with its shadow intact; shadows still toggle globally both ways. --- crates/wayland/src/state/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/wayland/src/state/mod.rs') diff --git a/crates/wayland/src/state/mod.rs b/crates/wayland/src/state/mod.rs index f39edcc..e07dc1d 100644 --- a/crates/wayland/src/state/mod.rs +++ b/crates/wayland/src/state/mod.rs @@ -114,6 +114,15 @@ pub(crate) struct DecorationSignature { pub(crate) maximized: bool, pub(crate) fullscreen: bool, pub(crate) shadows_enabled: bool, + /// A tiled window gets no shadow at all (see `redraw_decoration_ + /// buffer`'s own gate) - included here for the same "one signature, + /// every real input" reason as `maximized`/`fullscreen` just above: + /// toggling floating on its own (`srd.window.toggle_floating()`, + /// switching layouts) changes nothing else this signature already + /// tracks, so without this the cache would keep serving whichever + /// shadow state happened to be cached until some unrelated field + /// (a resize, a focus change) forced a rebuild anyway. + pub(crate) floating: bool, /// Which of *this* window's own titlebar buttons (if any) is currently /// hovered, and the glyph-reveal animation's current progress (0..=255) /// - see `CompState::hovered_titlebar_button`'s own doc comment. -- cgit v1.2.3