xserver-multidpi/hw/xwin
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
..
glx Full support of sRGB capable fbconfigs. 2013-03-18 10:02:00 -07:00
man hw/xwin: Enable RANDR resize by default 2012-11-27 16:09:11 +00:00
.gitignore XWin: build XWin man pages using XORG_MANPAGE_SECTIONS 2011-01-18 15:10:21 -08:00
ddraw.h hw/xwin: Fix for MinGW-w64 DirectDraw headers 2012-11-28 14:44:14 +00:00
InitInput.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
InitOutput.c hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
Makefile.am hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
propertystore.h hw/xwin: Add correct taskbar grouping of X windows on Windows 7 2012-11-27 16:08:22 +00:00
system.XWinrc Cygwin/X: Tidy up system.Xwinrc 2010-02-05 19:15:04 +00:00
win.h hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
winallpriv.c hw/xwin: Fix using index as a formal parameter shadows index() 2012-10-16 21:23:54 +01:00
winauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winblock.c hw/xwin: Process one Windows message per wakeup, rather than all of them. 2013-01-10 15:33:12 +00:00
winclip.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winclipboard.h hw/xwin: Use char strings in winClipboardUNIXtoDOS for consistency with the rest of the clipboard code 2012-10-16 22:29:50 +01:00
winclipboardinit.c hw/xwin: Tidy up some pointless output which is always emitted 2012-07-16 13:52:37 +01:00
winclipboardtextconv.c hw/xwin: Use char strings in winClipboardUNIXtoDOS for consistency with the rest of the clipboard code 2012-10-16 22:29:50 +01:00
winclipboardthread.c hw/xwin: Fix unused-but-set-variable warning in winClipboardProc() 2013-05-02 15:43:22 +01:00
winclipboardwndproc.c hw/xwin: Introduce winProcessXEventsTimeout() to the concept of fractions of a second 2012-08-03 22:48:09 +01:00
winclipboardwrappers.c hw/xwin: Fix redundant declarations in winclipboardwrappers.c 2012-10-16 21:19:00 +01:00
winclipboardxevents.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
wincmap.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winconfig.c Fix two typos "requires an string value" 2013-01-11 14:57:32 +10:00
winconfig.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
wincreatewnd.c hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor 2012-07-16 13:54:15 +01:00
wincursor.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
windialogs.c hw/xwin: Fix uses of CreateDialogParam() for 64-bit builds 2013-06-10 15:21:14 +01:00
winengine.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winerror.c hw/xwin: Show any fatal error message 2012-11-27 13:48:44 +00:00
winfillsp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winfont.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
wingc.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
wingetsp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winglobals.c hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
winglobals.h hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
winkeybd.c hw/xwin: Fix unused-but-set-variable warning in winIsFakeCtrl_L() 2013-05-02 15:43:14 +01:00
winkeybd.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winkeyhook.c hw/xwin: Remove a pointless OS version check in winInstallKeyboardHookLL() 2012-07-16 13:56:54 +01:00
winkeynames.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winlayouts.h hw/xwin: Fix warning about discarding const in initializing winKBLayouts 2012-10-16 22:29:49 +01:00
winmessages.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmisc.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winmonitors.c hw/xwin: Fix using index as a formal parameter in winmonitors.c shadows index() 2012-10-16 21:22:40 +01:00
winmonitors.h hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor 2012-07-16 13:54:15 +01:00
winmouse.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winms.h hw/xwin: Fix for MinGW-w64 DirectDraw headers 2012-11-28 14:44:14 +00:00
winmsg.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winmsg.h hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winmsg.c 2012-10-16 22:29:53 +01:00
winmsgwindow.c hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
winmultiwindowclass.c hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr 2013-06-10 15:48:08 +01:00
winmultiwindowclass.h hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr 2013-06-10 15:48:08 +01:00
winmultiwindowicons.c hw/xwin: Change winIconIsOverride() to take a HICON parameter 2013-06-10 15:25:44 +01:00
winmultiwindowicons.h hw/xwin: Make winOverrideIcon() thread-safe for icon data access 2012-08-03 22:47:42 +01:00
winmultiwindowshape.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winmultiwindowwindow.c hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type 2013-06-10 15:48:31 +01:00
winmultiwindowwm.c hw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly 2013-01-16 16:50:26 +00:00
winmultiwindowwndproc.c hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type 2013-06-10 15:48:31 +01:00
winnativegdi.c api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
winpfbdd.c hw/xwin: Fix unused-but-set-variable warning in winHotKeyAltTabPrimaryDD() 2013-05-02 15:43:25 +01:00
winpixmap.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winpolyline.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winprefs.c hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type 2013-06-10 15:48:31 +01:00
winprefs.h hw/xwin: Change winIconIsOverride() to take a HICON parameter 2013-06-10 15:25:44 +01:00
winprefslex.l hw/xwin: Fix various warnings in code generated by lex/yacc 2012-10-16 21:17:35 +01:00
winprefsyacc.y hw/xwin: Fix using menu as a formal parameter shadows a global variable of the same name 2012-10-16 21:24:23 +01:00
winprocarg.c hw/xwin: Enable RANDR resize by default 2012-11-27 16:09:11 +00:00
winrandr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winresource.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winrop.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winscrinit.c hw/xwin: Fix unused-but-set-variable warning in winFinishScreenInitFB() 2013-05-02 15:43:16 +01:00
winSetAppUserModelID.c hw/xwin: Fix MinGW build of winSetAppModelID.c 2013-01-10 15:33:13 +00:00
winsetsp.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winshaddd.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winshadddnl.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winshadgdi.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
wintaskbar.c hw/xwin: Add a simple interface to the ITaskbarList COM interface 2012-11-27 16:09:12 +00:00
wintrayicon.c hw/xwin: Bring the X screen window to the front on a single left-click on the tray icon 2013-01-10 15:33:08 +00:00
winvalargs.c hw/xwin: Remove unused variables in winvalargs.c 2012-10-17 13:18:17 +01:00
winvideo.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
winwakeup.c hw/xwin: Process one Windows message per wakeup, rather than all of them. 2013-01-10 15:33:12 +00:00
winwin32rootless.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winwin32rootlesswindow.c hw/xwin: Fix unused-but-set-variable warning in winMWExtWMUpdateWindowDecoration() 2013-05-02 15:43:27 +01:00
winwin32rootlesswndproc.c Fix formatting of address operators 2012-12-05 18:09:48 -06:00
winwindow.c hw/xwin: Fix unused-but-set-variable warning in winCopyWindowNativeGDI() 2013-05-02 15:43:18 +01:00
winwindow.h hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
winwindowswm.c hw/xwin: Fix unused-but-set-variable warning in ProcWindowsWMFrameGetRect() 2013-05-02 15:43:29 +01:00
winwndproc.c hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread 2013-07-23 23:58:50 +01:00
X.ico Cygwin/X: Update the native icon to one based on the X.Org logo 2008-12-15 12:42:10 +00:00
XWin.exe.manifest hw/xwin: Update manifest to target all architectures, not just x86 2013-06-10 15:48:34 +01:00
XWin.rc Cygwin/X: Left-justify website link in About box 2011-06-29 19:14:38 +01:00