From e9b376ce14e72ffcf9d6b403589f301c3881f443 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 9 Mar 2022 20:09:18 +0000 Subject: [PATCH] XEmbed: Add function to force window bounds update --- modules/juce_gui_extra/embedding/juce_XEmbedComponent.h | 3 +++ .../juce_gui_extra/native/juce_linux_XEmbedComponent.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h index 71c151b336..a4f7c14df5 100644 --- a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h +++ b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h @@ -89,6 +89,9 @@ public: /** Removes the client window from the host. */ void removeClient(); + /** Forces the embedded window to match the current size of this component. */ + void updateEmbeddedBounds(); + protected: //============================================================================== /** @internal */ diff --git a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp index 5d4d5daf98..bf535a2b56 100644 --- a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp @@ -250,6 +250,11 @@ public: return host; } + void updateEmbeddedBounds() + { + componentMovedOrResized (owner, true, true); + } + private: //============================================================================== XEmbedComponent& owner; @@ -680,6 +685,7 @@ void XEmbedComponent::focusLost (FocusChangeType changeType) { pimpl->focu void XEmbedComponent::broughtToFront() { pimpl->broughtToFront(); } unsigned long XEmbedComponent::getHostWindowID() { return pimpl->getHostWindowID(); } void XEmbedComponent::removeClient() { pimpl->setClient (0, true); } +void XEmbedComponent::updateEmbeddedBounds() { pimpl->updateEmbeddedBounds(); } //============================================================================== bool juce_handleXEmbedEvent (ComponentPeer* p, void* e)