From 0f19ba0c0e4bc4c10b7442e9c977477bf8af34ed Mon Sep 17 00:00:00 2001 From: hobbs Date: Wed, 5 Apr 2006 20:56:40 +0000 Subject: * win/tkWinWm.c (WmProc): pass WM_QUERYENDSESSION message to Tk as WM_SAVE_YOURSELF wm protocol callback. --- win/tkWinWm.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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; } -- cgit v0.12