diff --git a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h index d925d73fc4..21e9cb0960 100644 --- a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h +++ b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h @@ -78,6 +78,19 @@ public: return withMember (*this, &XEmbedComponentOptions::allowForeignWidgetToResizeComponent, x); } + /** When this option is enabled the client window will be unconditionally mapped regardless of + the value of the XEMBED_MAPPED flag. + + You should generally not use this option. The default value is false. + + It's used internally by JUCE plugin hosting to accommodate some plugins that report + XEmbedInfo compatibility, but don't set the flag. + */ + [[nodiscard]] XEmbedComponentOptions withIgnoreXembedMapped (bool x = true) const + { + return withMember (*this, &XEmbedComponentOptions::ignoreXembedMapped, x); + } + /** @see withClientWindow() */ [[nodiscard]] auto getClientWindow() const { return clientWindow; } @@ -87,10 +100,14 @@ public: /** @see withAllowForeignWidgetToResizeComponent() */ [[nodiscard]] bool getAllowForeignWidgetToResizeComponent() const { return allowForeignWidgetToResizeComponent; } + /** @see withIgnoreXembedMapped() */ + [[nodiscard]] bool getIgnoreXembedMapped() const { return ignoreXembedMapped; } + private: unsigned long clientWindow{}; bool wantsKeyboardFocus = true; bool allowForeignWidgetToResizeComponent = false; + bool ignoreXembedMapped = false; }; //============================================================================== diff --git a/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp b/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp index 67adb5abf5..004ea1d918 100644 --- a/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp +++ b/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp @@ -317,7 +317,7 @@ private: if (window == 0) return; - const auto shouldBeMapped = pimpl.getXEmbedMappedFlag() + const auto shouldBeMapped = (pimpl.getXEmbedMappedFlag() || pimpl.options.getIgnoreXembedMapped()) && pimpl.owner.isShowing() && pimpl.lastPeer != nullptr;