summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-04-05 20:56:40 (GMT)
committerhobbs <hobbs>2006-04-05 20:56:40 (GMT)
commit0f19ba0c0e4bc4c10b7442e9c977477bf8af34ed (patch)
treece777de6b406a9b41b1ad4f2076b2e7d0969abd6 /win/tkWinWm.c
parent636d1fed7fa814e48effbb3957c30157b559069b (diff)
downloadtk-0f19ba0c0e4bc4c10b7442e9c977477bf8af34ed.zip
tk-0f19ba0c0e4bc4c10b7442e9c977477bf8af34ed.tar.gz
tk-0f19ba0c0e4bc4c10b7442e9c977477bf8af34ed.tar.bz2
* win/tkWinWm.c (WmProc): pass WM_QUERYENDSESSION message to Tk as
WM_SAVE_YOURSELF wm protocol callback.
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index be5e96d..c9a8777 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.108 2005/12/29 10:46:46 vincentdarley Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.109 2006/04/05 20:56:40 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -7809,6 +7809,22 @@ WmProc(
goto done;
}
+ case WM_QUERYENDSESSION: {
+ XEvent event;
+
+ /*
+ * Synthesize WM_SAVE_YOURSELF wm protocol message on Windows logout
+ * or restart.
+ */
+ winPtr = GetTopLevel(hwnd);
+ event.xclient.message_type =
+ Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS");
+ event.xclient.data.l[0] =
+ Tk_InternAtom((Tk_Window) winPtr, "WM_SAVE_YOURSELF");
+ TkWmProtocolEventProc(winPtr, &event);
+ break;
+ }
+
default:
break;
}