From: Vadim Zeitlin Date: Sat, 25 Aug 2001 17:56:34 +0000 (+0000) Subject: fixed return value of HandleEndSession to return true only if the message was really... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/519dc37fafc2df09bb9361c6bf0e5e6552fee3c5 fixed return value of HandleEndSession to return true only if the message was really processed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 6be083a03d..c9a9494c0e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3024,15 +3024,16 @@ bool wxWindowMSW::HandleEndSession(bool endSession, long logOff) if ( !endSession ) return FALSE; + // only send once + if ( (this != wxTheApp->GetTopWindow()) ) + return FALSE; + wxCloseEvent event(wxEVT_END_SESSION, -1); event.SetEventObject(wxTheApp); event.SetCanVeto(FALSE); event.SetLoggingOff( (logOff == (long)ENDSESSION_LOGOFF) ); - if ( (this == wxTheApp->GetTopWindow()) && // Only send once - wxTheApp->ProcessEvent(event)) - { - } - return TRUE; + + return wxTheApp->ProcessEvent(event); } // ---------------------------------------------------------------------------