Alex ter Weele <alex.ter.we...@gmail.com> writes: > > $ echo $LD_LIBRARY_PATH > > $ echo $LD_PRELOAD > > /gnu/store/hfz0z0fs14jgl0kzk5hid2msr83lxii1-spectrwm-3.1.0/lib/libswmhack.so.0.0 > > That's weird, looks like my WM set LD_PRELOAD. I wouldn't have expected > that. And sure enough, with LD_PRELOAD unset: > > $ LD_PRELOAD= emacs -Q --eval "(kill-emacs)" > ...(GTK warnings omitted) > $ echo $? > 0 > > So why and how does spectrwm set LD_PRELOAD? I can't figure this out.
OK, I figured it out: https://github.com/conformal/spectrwm/blob/SPECTRWM_3_1_0/spectrwm.c#L3764. Looks like it injects libswmhack.so so that it can intercept X events, e.g. https://github.com/conformal/spectrwm/blob/SPECTRWM_3_1_0/lib/swm_hack.c#L137