External plugin wrappers can outlive a crashed panel
Summary
An external wrapper-2.0 process can stay alive indefinitely after the xfce4-panel process that launched it dies. I saw a systray wrapper reparented to PID 1 for hours after repeated panel restarts, still holding its X windows.
Cause
wrapper/main.c exits when the org.xfce.Panel D-Bus name loses its owner. That check does not identify the wrapper's own panel. If another panel process already owns the name when the launching panel dies, the orphaned wrapper still sees a valid owner and keeps running.
Proposed fix
The attached patch arms PR_SET_PDEATHSIG(SIGKILL) in the post-fork child setup before each X11 or Wayland wrapper exec. It passes the panel PID captured before g_spawn_async() and checks getppid() right after prctl(), so a panel that dies before the signal is armed is also caught, even when a subreaper adopts the child. Normal panel restarts still use the existing graceful D-Bus quit path. SIGKILL only fires when the parent disappears unexpectedly.
The patch uses the existing HAVE_SYS_PRCTL_H check from meson.build.
Validation
- The patch applies to current master (
63d671643) and to 4.20.8. - The openSUSE Tumbleweed 4.20.8 package builds with it, and I have run that build on my desktop since 2026-10-02 with no orphaned wrappers. The panel was only replaced by logging out and in again, so the orphan case did not come up on its own.
- To test the case directly, I ran the patched panel under Xvfb with its own D-Bus session, stopped all six wrappers with SIGSTOP (so none of them could run the D-Bus handler), then killed the panel with SIGKILL. All six wrappers were gone two seconds later.
strace -fon the same setup showsprctl(PR_SET_PDEATHSIG, SIGKILL) = 0in every wrapper child before exec.