diff --git a/mac/wxMac_additions/eventloops.patch b/mac/wxMac_additions/eventloops.patch index 7b321c980..67a0ac44f 100644 --- a/mac/wxMac_additions/eventloops.patch +++ b/mac/wxMac_additions/eventloops.patch @@ -1,4 +1,4 @@ -From aed0a3ed0df16f04dc39c8366d9c399fcc172009 Mon Sep 17 00:00:00 2001 +From 8c9c17ca704f6c2b1469c861497ac7676dd67347 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 31 Jul 2016 11:55:29 -0400 Subject: [PATCH 1/3] Mac modal loops won't hang when other code uses old @@ -13,20 +13,21 @@ See the Audacity bug report that motivated this change: http://bugzilla.audacityteam.org/show_bug.cgi?id=1338 --- - include/wx/evtloop.h | 9 +++++++++ + include/wx/evtloop.h | 10 ++++++++++ src/common/evtloopcmn.cpp | 14 ++++++++++++++ src/osx/core/evtloop_cf.cpp | 3 ++- - 3 files changed, 25 insertions(+), 1 deletion(-) + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/wx/evtloop.h b/include/wx/evtloop.h -index 1133473..db87431 100644 +index 1133473..4b23610 100644 --- a/include/wx/evtloop.h +++ b/include/wx/evtloop.h -@@ -177,6 +177,15 @@ public: +@@ -177,6 +177,16 @@ public: // set currently active (running) event loop static void SetActive(wxEventLoopBase* loop); +#ifdef __WXMAC__ ++#define __WX_EVTLOOP_BUSY_WAITING__ + static bool GetBusyWaiting(); + + // If the argument is true, cause modal dialogs to busy-wait for events, diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 4dc9583c4..036c59a9d 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -1788,7 +1788,9 @@ bool VSTEffect::HideUI() bool VSTEffect::CloseUI() { #ifdef __WXMAC__ +#ifdef __WX_EVTLOOP_BUSY_WAITING__ wxEventLoop::SetBusyWaiting(false); +#endif #endif mParent->RemoveEventHandler(this); @@ -2840,7 +2842,9 @@ void VSTEffect::BuildFancy() mDialog->Connect(wxEVT_SIZE, wxSizeEventHandler(VSTEffect::OnSize)); #ifdef __WXMAC__ +#ifdef __WX_EVTLOOP_BUSY_WAITING__ wxEventLoop::SetBusyWaiting(true); +#endif #endif return; diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index b29364613..92ea6542f 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -1799,7 +1799,9 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent) mParent->SetMinSize(wxDefaultSize); #ifdef __WXMAC__ +#ifdef __WX_EVTLOOP_BUSY_WAITING__ wxEventLoop::SetBusyWaiting(true); +#endif #endif } @@ -1848,7 +1850,9 @@ bool AudioUnitEffect::HideUI() bool AudioUnitEffect::CloseUI() { #ifdef __WXMAC__ +#ifdef __WX_EVTLOOP_BUSY_WAITING__ wxEventLoop::SetBusyWaiting(false); +#endif #endif mParent->RemoveEventHandler(this); diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp index 91b4e921f..2186a64aa 100644 --- a/src/effects/lv2/LV2Effect.cpp +++ b/src/effects/lv2/LV2Effect.cpp @@ -1139,7 +1139,9 @@ bool LV2Effect::HideUI() bool LV2Effect::CloseUI() { #ifdef __WXMAC__ +#ifdef __WX_EVTLOOP_BUSY_WAITING__ wxEventLoop::SetBusyWaiting(false); +#endif #endif mParent->RemoveEventHandler(this); @@ -1571,7 +1573,9 @@ bool LV2Effect::BuildFancy() TransferDataToWindow(); #ifdef __WXMAC__ +#ifdef __WX_EVTLOOP_BUSY_WAITING__ wxEventLoop::SetBusyWaiting(true); +#endif #endif return true;