diff options
| author | srdusr <[email protected]> | 2026-01-30 09:39:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2026-01-30 09:39:00 +0200 |
| commit | 2a51fb86e2a123ff9e810a0b4105c9fe5f85e3ae (patch) | |
| tree | 7a1fc6b2b87cd0bf82bc8953ba0a2a9e65c9e7cf /crates/wayland/src/state/mod.rs | |
| parent | d16f7dab25bd9508271017bc6dc15024c30cbf71 (diff) | |
| download | srdwm-2a51fb86e2a123ff9e810a0b4105c9fe5f85e3ae.tar.gz srdwm-2a51fb86e2a123ff9e810a0b4105c9fe5f85e3ae.zip | |
Fix a real regression: dynamic-mode windows lost their shadow via toggle_floating
The tiled-shadow-tint fix earlier today gated the shadow on Window::floating
alone. arrange_workspace only reads floating under the "tiling" layout, so
every window on this project's own default "dynamic" layout starts, and
stays, floating: false - the gate misread that as "tiled, no shadow"
regardless of which layout was actually running, so shadows silently
vanished under dynamic mode entirely, recoverable only by pressing Super+S
(toggle_floating), which then looked like that key toggles a tint rather
than floating. Fixed by checking the workspace's own layout name first:
a window is only "currently tiled" when its workspace runs "tiling" AND
it hasn't opted out via floating. DecorationSignature's floating field is
now currently_tiled, since a layout switch changes this for every window
on a workspace without touching any of their own floating fields.
Also disabled general.shadows in the user's own config per direct
request - never asked for, on by default, and a real problem for
color-accuracy work regardless of how correctly it renders otherwise.
Also fixed both context menus (titlebar and desktop) silently truncating
labels past a fixed 170px width with no indication - widened dynamically
to each menu's own real widest label via a new measure_text_width helper.
Diffstat (limited to 'crates/wayland/src/state/mod.rs')
| -rw-r--r-- | crates/wayland/src/state/mod.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/crates/wayland/src/state/mod.rs b/crates/wayland/src/state/mod.rs index e07dc1d..6396692 100644 --- a/crates/wayland/src/state/mod.rs +++ b/crates/wayland/src/state/mod.rs @@ -114,15 +114,18 @@ 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, + /// A window actually occupying a tiled slot right now (its workspace + /// is running the `"tiling"` layout, and it hasn't opted out via + /// `Window::floating`) gets no shadow at all - see `redraw_ + /// decoration_buffer`'s own gate. Deliberately *not* just `Window:: + /// floating` on its own: a workspace's layout name changing (`Super+ + /// Shift+t`/`s`) affects every window on it without touching any of + /// their own `floating` fields, and toggling `floating` alone + /// (`srd.window.toggle_floating()`) changes nothing else this + /// signature already tracks - without this field, either change + /// would leave the cache serving whichever shadow state it last + /// computed until some unrelated field forced a rebuild anyway. + pub(crate) currently_tiled: 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. |