From 47d441787c9af0bbf5ba0a0694fe4f516be78be9 Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 9 Sep 2025 17:20:59 +0200 Subject: [PATCH] Linux: Fix bad window error when using the XEmbedComponent The issue was reproducible by opening a plugin window in the AudioPluginHost. --- .../format_types/juce_LV2PluginFormat.cpp | 1 + modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp index 2de7a6d84f..592e7e7057 100644 --- a/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp @@ -3190,6 +3190,7 @@ private: Inner() : XEmbedComponent (true, true) { setOpaque (true); + setVisible (true); addToDesktop (0); } }; diff --git a/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp b/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp index f2b48814a8..47a8d14b0a 100644 --- a/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp +++ b/modules/juce_gui_extra/native/juce_XEmbedComponent_linux.cpp @@ -459,6 +459,9 @@ private: //============================================================================== bool getXEmbedMappedFlag() { + if (client == 0) + return false; + XWindowSystemUtilities::GetXProperty embedInfo (getDisplay(), client, infoAtom, 0, 2, false, infoAtom); if (embedInfo.success && embedInfo.actualFormat == 32