Created attachment 15588 [details] [review] Patch ungrabbing on all code paths When dbus-launch is run and something has already stored the address on the X11 display, it calls XUngrabServer(), then goes off and runs a non-X11 main loop. This means that the UngrabServer request is buffered but not actually sent, and the server remains grabbed forever. Attached patch fixes by making sure that the XFlush() is called on all code paths.
This sounds reasonable, though I'm frightened of actually opening up the dbus-launch.c file. One thing that might be worth considering is some explicit way for a second dbus-session program to override the first.
Created attachment 15589 [details] [review] Patch improving X11 handling Turns out that I was slightly wrong when I said "then goes off and runs a non-X11 main loop". What it does instead is go off and run the X11-including main loop, but that loop is slightly buggy in that it doesn't check for events *before* selecting. I'll attach a patch to fix that, though I think it makes no practical difference here. But if someone cuts-and-pastes the code, or extends dbus-launch they could get caught. I'd recommend applying both patches, though either by themselves would fix the problem.
Both patches applied.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.