xserver-multidpi/hw
Jon TURNEY 682ccac90b hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread
Currently, WM_ENDSESSION just calls GiveUp() to set the DE_TERMINATE flag. But
for the X server to exit cleanly, we also need the X server dispatch loop to be
unblocked so it can notice that DE_TERMINATE has been set and exit, removing
it's lock file and any unix domain socket.

It appears that the system will terminate the process when the last UI thread in
that process returns from processing WM_ENDSESSION for the last top-level
window.

Since WM_ENDSESSION appears to sent by the system via SendMessage()
(synchronously) and the wndproc is called to process it in the message thread
for that window (the X server thread), we can't easily terminate the X server
dispatch loop from inside the WM_ENDSESSION message processing.

So, create a messaging window, a hidden, top-level window, with a separate
thread to catch this message, and process it by calling GiveUp() and then
blocking on a mutex until the X server dispatch loop exits.

Also, notice when this is a shutdown cancel WM_ENDSESSION message and take no
action.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:58:50 +01:00
..
dmx glxproxy: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData 2013-07-17 18:10:41 -07:00
kdrive Xephyr: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData 2013-07-17 18:10:41 -07:00
vfb vfb: Initialize the GLX extension again. 2012-11-21 11:13:55 +11:00
xfree86 dix: scale y back instead of x up when pre-scaling coordinates 2013-07-22 14:18:30 +10:00
xnest Fix typo in header guard. 2013-07-17 18:11:41 -07:00
xquartz Full support of sRGB capable fbconfigs. 2013-03-18 10:02:00 -07:00
xwin hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
Makefile.am Catch errors in recursive relink targets 2010-03-22 00:45:57 -05:00