mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-01 03:32:58 +00:00
On windows, ignore WM_QUERYENDSESSION and close upon WM_ENDSESSION.
The messages can come through CFrame::MSWWindowProc and the wxApp implementation, so make sure to catch both. Fixes issue 6546.
This commit is contained in:
parent
2d492bdc4f
commit
484130049d
@ -539,10 +539,25 @@ void CFrame::OnResize(wxSizeEvent& event)
|
|||||||
WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
if (WM_SYSCOMMAND == nMsg && (SC_SCREENSAVE == wParam || SC_MONITORPOWER == wParam))
|
if (WM_SYSCOMMAND == nMsg && (SC_SCREENSAVE == wParam || SC_MONITORPOWER == wParam))
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
else if (nMsg == WM_QUERYENDSESSION)
|
||||||
|
{
|
||||||
|
// Indicate that the application will be able to close
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (nMsg == WM_ENDSESSION)
|
||||||
|
{
|
||||||
|
// Actually trigger the close now
|
||||||
|
Close(true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
|
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CFrame::OnHostMessage(wxCommandEvent& event)
|
void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||||
|
@ -71,6 +71,8 @@ IMPLEMENT_APP(DolphinApp)
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(DolphinApp, wxApp)
|
BEGIN_EVENT_TABLE(DolphinApp, wxApp)
|
||||||
EVT_TIMER(wxID_ANY, DolphinApp::AfterInit)
|
EVT_TIMER(wxID_ANY, DolphinApp::AfterInit)
|
||||||
|
EVT_QUERY_END_SESSION(DolphinApp::OnEndSession)
|
||||||
|
EVT_END_SESSION(DolphinApp::OnEndSession)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
@ -433,6 +435,15 @@ void DolphinApp::InitLanguageSupport()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DolphinApp::OnEndSession(wxCloseEvent& event)
|
||||||
|
{
|
||||||
|
// Close if we've recieved wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
|
||||||
|
if (!event.CanVeto())
|
||||||
|
{
|
||||||
|
main_frame->Close(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int DolphinApp::OnExit()
|
int DolphinApp::OnExit()
|
||||||
{
|
{
|
||||||
WiimoteReal::Shutdown();
|
WiimoteReal::Shutdown();
|
||||||
|
@ -33,6 +33,7 @@ private:
|
|||||||
wxLocale *m_locale;
|
wxLocale *m_locale;
|
||||||
|
|
||||||
void AfterInit(wxTimerEvent& WXUNUSED(event));
|
void AfterInit(wxTimerEvent& WXUNUSED(event));
|
||||||
|
void OnEndSession(wxCloseEvent& event);
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_APP(DolphinApp);
|
DECLARE_APP(DolphinApp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user