diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 504d1ba0..c58990be 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -824,6 +824,8 @@ EVT_DROP_FILES(MainFrame::OnDropFile) // for window geometry EVT_MOVE(MainFrame::OnMove) +EVT_MOVE_START(MainFrame::OnMoveStart) +EVT_MOVE_END(MainFrame::OnMoveEnd) EVT_SIZE(MainFrame::OnSize) // For tracking menubar state. @@ -879,6 +881,20 @@ void MainFrame::OnMove(wxMoveEvent&) { } } +// On Windows pause sound when moving and resizing the window to prevent dsound +// from looping. +void MainFrame::OnMoveStart(wxMoveEvent&) { +#ifdef __WXMSW__ + soundPause(); +#endif +} + +void MainFrame::OnMoveEnd(wxMoveEvent&) { +#ifdef __WXMSW__ + soundResume(); +#endif +} + void MainFrame::OnSize(wxSizeEvent& event) { wxFrame::OnSize(event); diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index dfe7b2b3..ea0659b8 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -382,6 +382,8 @@ private: void OnMenu(wxContextMenuEvent&); // window geometry void OnMove(wxMoveEvent& event); + void OnMoveStart(wxMoveEvent& event); + void OnMoveEnd(wxMoveEvent& event); void OnSize(wxSizeEvent& event); // Load a named wxDialog from the XRC file wxDialog* LoadXRCDialog(const char* name);