diff options
| author | srdusr <[email protected]> | 2026-07-20 20:31:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2026-07-20 20:31:00 +0200 |
| commit | c3a34348b39c9518ad2e5bb28569fb9d78ce5dc1 (patch) | |
| tree | e427560f124ce97dc2553a8f3fca6ea49c1f3e37 /crates/wayland/src/state/mod.rs | |
| parent | 5611194ef57cd766223a01932cffa2969a81a983 (diff) | |
| download | srdwm-c3a34348b39c9518ad2e5bb28569fb9d78ce5dc1.tar.gz srdwm-c3a34348b39c9518ad2e5bb28569fb9d78ce5dc1.zip | |
Fix the nested guard: it answered wrong for a real session, and missed a case
The guard added earlier tonight asked "is WAYLAND_DISPLAY or DISPLAY set".
Both Wayland backends call set_var("WAYLAND_DISPLAY", ...) on themselves the
moment they bind their own socket, so after startup that question answers
"yes" for a real udev session too. Every publish on the config-reload path
runs after that point, which means a live session that reloaded its config
would have stopped publishing its own GTK settings - the exact opposite of
what the guard is for. It also treated srdwm-x as nested, because an X11
session naturally has DISPLAY set, even though srdwm is that display's
window manager and not a client of anything.
Nestedness is now read once, at startup, before any backend is up, and
only the Wayland backend can be nested. A test pins the second half.
The same reasoning applies to window_memory::save_all, which had no guard
at all: a nested instance shares HOME with the session it runs inside, so
dragging a test window would overwrite where that application opens in the
real session - a 1280x800 test window's position applied to a 3840x1080
desktop. Loading stays unconditional and deliberate: honouring what a real
session remembered is right, writing back over it is not. That side reads
srdwm_wayland::running_nested, recorded by connect at the moment it picks
the winit backend, since the environment can no longer be asked afterward.
Verified: a nested run with a scratch config left both the stylesheet and
window-memory.json untouched (md5 before and after, and no test window's
app-id in the store).
Diffstat (limited to 'crates/wayland/src/state/mod.rs')
0 files changed, 0 insertions, 0 deletions