diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 6e37d7b289..619e7722ae 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -633,7 +633,7 @@ #include #endif -#if JUCE_MEDIAFOUNDATION && JUCE_BUILD_NATIVE +#if JUCE_DIRECTSHOW && JUCE_MEDIAFOUNDATION && JUCE_BUILD_NATIVE #include #endif @@ -88166,11 +88166,17 @@ public: } else { - SoftwareRendererClasses::ClipRegionBase::Ptr c (new SoftwareRendererClasses::ClipRegion_EdgeTable (Rectangle (tx, ty, sourceImage.getWidth(), sourceImage.getHeight()).getIntersection (image.getBounds()))); - c = clip->applyClipTo (c); + Rectangle area (tx, ty, sourceImage.getWidth(), sourceImage.getHeight()); + area = area.getIntersection (image.getBounds()); - if (c != nullptr) - c->renderImageUntransformed (destData, srcData, alpha, tx, ty, false); + if (! area.isEmpty()) + { + SoftwareRendererClasses::ClipRegionBase::Ptr c (new SoftwareRendererClasses::ClipRegion_EdgeTable (area)); + c = clip->applyClipTo (c); + + if (c != nullptr) + c->renderImageUntransformed (destData, srcData, alpha, tx, ty, false); + } } return; @@ -252879,7 +252885,7 @@ void QuickTimeMovieComponent::setBoundsWithCorrectAspectRatio (const Rectangleinvoke (info, true); } - currentModel->menuItemSelected (commandId, topLevelIndex); + (new AsyncCommandInvoker (commandId, topLevelIndex))->post(); } } + void invokeDirectly (const int commandId, const int topLevelIndex) + { + if (currentModel != nullptr) + currentModel->menuItemSelected (commandId, topLevelIndex); + } + void addMenuItem (PopupMenu::MenuItemIterator& iter, NSMenu* menuToAddTo, const int topLevelMenuId, const int topLevelIndex) { @@ -283649,6 +283661,25 @@ private: private: JUCE_DECLARE_NON_COPYABLE (AsyncMenuUpdater); }; + + class AsyncCommandInvoker : public CallbackMessage + { + public: + AsyncCommandInvoker (const int commandId_, const int topLevelIndex_) + : commandId (commandId_), topLevelIndex (topLevelIndex_) + {} + + void messageCallback() + { + if (JuceMainMenuHandler::instance != nullptr) + JuceMainMenuHandler::instance->invokeDirectly (commandId, topLevelIndex); + } + + private: + const int commandId, topLevelIndex; + + JUCE_DECLARE_NON_COPYABLE (AsyncCommandInvoker); + }; }; JuceMainMenuHandler* JuceMainMenuHandler::instance = nullptr; diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 1a8daf0f7e..b685d84153 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 102 +#define JUCE_BUILDNUMBER 103 /** Current Juce version number. diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index a501ada35a..a0bfd50664 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 102 +#define JUCE_BUILDNUMBER 103 /** Current Juce version number. diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index 9da1dff4c6..8c32c2e71a 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -2144,11 +2144,17 @@ public: } else { - SoftwareRendererClasses::ClipRegionBase::Ptr c (new SoftwareRendererClasses::ClipRegion_EdgeTable (Rectangle (tx, ty, sourceImage.getWidth(), sourceImage.getHeight()).getIntersection (image.getBounds()))); - c = clip->applyClipTo (c); + Rectangle area (tx, ty, sourceImage.getWidth(), sourceImage.getHeight()); + area = area.getIntersection (image.getBounds()); - if (c != nullptr) - c->renderImageUntransformed (destData, srcData, alpha, tx, ty, false); + if (! area.isEmpty()) + { + SoftwareRendererClasses::ClipRegionBase::Ptr c (new SoftwareRendererClasses::ClipRegion_EdgeTable (area)); + c = clip->applyClipTo (c); + + if (c != nullptr) + c->renderImageUntransformed (destData, srcData, alpha, tx, ty, false); + } } return; diff --git a/src/native/mac/juce_mac_MainMenu.mm b/src/native/mac/juce_mac_MainMenu.mm index f24e14090f..14646f4387 100644 --- a/src/native/mac/juce_mac_MainMenu.mm +++ b/src/native/mac/juce_mac_MainMenu.mm @@ -184,10 +184,16 @@ public: commandManager->invoke (info, true); } - currentModel->menuItemSelected (commandId, topLevelIndex); + (new AsyncCommandInvoker (commandId, topLevelIndex))->post(); } } + void invokeDirectly (const int commandId, const int topLevelIndex) + { + if (currentModel != nullptr) + currentModel->menuItemSelected (commandId, topLevelIndex); + } + void addMenuItem (PopupMenu::MenuItemIterator& iter, NSMenu* menuToAddTo, const int topLevelMenuId, const int topLevelIndex) { @@ -370,6 +376,25 @@ private: private: JUCE_DECLARE_NON_COPYABLE (AsyncMenuUpdater); }; + + class AsyncCommandInvoker : public CallbackMessage + { + public: + AsyncCommandInvoker (const int commandId_, const int topLevelIndex_) + : commandId (commandId_), topLevelIndex (topLevelIndex_) + {} + + void messageCallback() + { + if (JuceMainMenuHandler::instance != nullptr) + JuceMainMenuHandler::instance->invokeDirectly (commandId, topLevelIndex); + } + + private: + const int commandId, topLevelIndex; + + JUCE_DECLARE_NON_COPYABLE (AsyncCommandInvoker); + }; }; JuceMainMenuHandler* JuceMainMenuHandler::instance = nullptr; diff --git a/src/native/windows/juce_win32_DirectShowComponent.cpp b/src/native/windows/juce_win32_DirectShowComponent.cpp index 096e026cd8..416a1cdb5c 100644 --- a/src/native/windows/juce_win32_DirectShowComponent.cpp +++ b/src/native/windows/juce_win32_DirectShowComponent.cpp @@ -23,7 +23,7 @@ ============================================================================== */ -#if JUCE_INCLUDED_FILE +#if JUCE_INCLUDED_FILE && JUCE_DIRECTSHOW //====================================================================== diff --git a/src/native/windows/juce_win32_NativeIncludes.h b/src/native/windows/juce_win32_NativeIncludes.h index 681f91773c..475c3a9a0d 100644 --- a/src/native/windows/juce_win32_NativeIncludes.h +++ b/src/native/windows/juce_win32_NativeIncludes.h @@ -150,7 +150,7 @@ #include #endif -#if JUCE_MEDIAFOUNDATION && JUCE_BUILD_NATIVE +#if JUCE_DIRECTSHOW && JUCE_MEDIAFOUNDATION && JUCE_BUILD_NATIVE #include #endif