LGFae / swww

A Solution to your Wayland Wallpaper Woes
GNU General Public License v3.0
2.38k stars 70 forks source link

Fix connecting to Wayland via WAYLAND_SOCKET #358

Closed mstoeckl closed 2 months ago

mstoeckl commented 2 months ago

This fixes a crash when swww-daemon is run using a Wayland connection socket provided through the WAYLAND_SOCKET environment variable. (The easiest way of which I am aware to test this is to run waypipe--oneshot ssh localhost swww-daemon). Before this change swww-daemon (commit 886ce3e9c5d88187fd765fe22c92338b038177c8) would produce the error

thread 'main' panicked at daemon/src/wayland/globals.rs:215:51:
failed to connect to unix socket: Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }

After this change, it should work (or possibly crash with EWouldBlock at a super::wire::WireMsg::recv().unwrap()), but that's a different issue I don't have time for today.)

LGFae commented 2 months ago

Ah, my bad, I thought I had merged this already, but apparently I forgot.

In any case, thanks!