mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
Fix pause when inactive for new wxWidgets
Handle the Iconize event to pause when "pause when inactive" is enabled, to work around a change in recent versions of wxWidgets that ignore this unfocus event. Fix #1494. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
@@ -985,6 +985,7 @@ EVT_MOVE(MainFrame::OnMove)
|
|||||||
EVT_MOVE_START(MainFrame::OnMoveStart)
|
EVT_MOVE_START(MainFrame::OnMoveStart)
|
||||||
EVT_MOVE_END(MainFrame::OnMoveEnd)
|
EVT_MOVE_END(MainFrame::OnMoveEnd)
|
||||||
EVT_SIZE(MainFrame::OnSize)
|
EVT_SIZE(MainFrame::OnSize)
|
||||||
|
EVT_ICONIZE(MainFrame::OnIconize)
|
||||||
|
|
||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
|
|
||||||
@@ -1088,6 +1089,17 @@ void MainFrame::OnSize(wxSizeEvent& event)
|
|||||||
OPTION(kGeomFullScreen) = IsFullScreen();
|
OPTION(kGeomFullScreen) = IsFullScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainFrame::OnIconize(wxIconizeEvent& event)
|
||||||
|
{
|
||||||
|
if (!init_complete_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OPTION(kPrefPauseWhenInactive)) {
|
||||||
|
panel->Pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxString MainFrame::GetGamePath(wxString path)
|
wxString MainFrame::GetGamePath(wxString path)
|
||||||
{
|
{
|
||||||
wxString game_path = path;
|
wxString game_path = path;
|
||||||
|
@@ -360,6 +360,8 @@ private:
|
|||||||
void OnMoveStart(wxMoveEvent& event);
|
void OnMoveStart(wxMoveEvent& event);
|
||||||
void OnMoveEnd(wxMoveEvent& event);
|
void OnMoveEnd(wxMoveEvent& event);
|
||||||
void OnSize(wxSizeEvent& event);
|
void OnSize(wxSizeEvent& event);
|
||||||
|
void OnIconize(wxIconizeEvent& event);
|
||||||
|
|
||||||
// Load a named wxDialog from the XRC file
|
// Load a named wxDialog from the XRC file
|
||||||
wxDialog* LoadXRCDialog(const char* name);
|
wxDialog* LoadXRCDialog(const char* name);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user