1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

XEmbedComponent: Add new option to ignore the XEMBED_MAPPED flag

This commit is contained in:
attila 2026-01-08 00:06:45 +01:00 committed by Attila Szarvas
parent fde2512f64
commit 9d45b5bc30
2 changed files with 18 additions and 1 deletions

View file

@ -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;
};
//==============================================================================

View file

@ -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;