1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

Fixed resizing issues and memory leaks in linux web browser component

This commit is contained in:
hogliux 2017-04-26 19:18:39 +01:00
parent 1234775fc7
commit 7a7619d64e
4 changed files with 78 additions and 17 deletions

View file

@ -203,9 +203,10 @@ public:
public:
//==============================================================================
Pimpl (XEmbedComponent& parent, Window x11Window, bool wantsKeyboardFocus, bool isClientInitiated)
Pimpl (XEmbedComponent& parent, Window x11Window,
bool wantsKeyboardFocus, bool isClientInitiated, bool shouldAllowResize)
: owner (parent), atoms (x11display.get()), clientInitiated (isClientInitiated),
wantsFocus (wantsKeyboardFocus)
wantsFocus (wantsKeyboardFocus), allowResize (shouldAllowResize)
{
if (widgets == nullptr)
widgets = new Array<Pimpl*>;
@ -337,6 +338,7 @@ private:
bool clientInitiated;
bool wantsFocus = false;
bool allowResize = false;
bool supportsXembed = false;
bool hasBeenMapped = false;
int xembedVersion = maxXEmbedVersionToSupport;
@ -582,7 +584,11 @@ private:
propertyChanged (e.xproperty.atom);
return true;
case ConfigureNotify:
configureNotify();
if (allowResize)
configureNotify();
else
MessageManager::callAsync([this] () {componentMovedOrResized (owner, true, true);});
return true;
}
}
@ -713,14 +719,14 @@ Array<XEmbedComponent::Pimpl*>* XEmbedComponent::Pimpl::widgets = nullptr;
HashMap<ComponentPeer*,XEmbedComponent::Pimpl::SharedKeyWindow*>* XEmbedComponent::Pimpl::SharedKeyWindow::keyWindows = nullptr;
//==============================================================================
XEmbedComponent::XEmbedComponent (bool wantsKeyboardFocus)
: pimpl (new Pimpl (*this, 0, wantsKeyboardFocus, false))
XEmbedComponent::XEmbedComponent (bool wantsKeyboardFocus, bool allowForeignWidgetToResizeComponent)
: pimpl (new Pimpl (*this, 0, wantsKeyboardFocus, false, allowForeignWidgetToResizeComponent))
{
setOpaque (true);
}
XEmbedComponent::XEmbedComponent (unsigned long wID, bool wantsKeyboardFocus)
: pimpl (new Pimpl (*this, wID, wantsKeyboardFocus, true))
XEmbedComponent::XEmbedComponent (unsigned long wID, bool wantsKeyboardFocus, bool allowForeignWidgetToResizeComponent)
: pimpl (new Pimpl (*this, wID, wantsKeyboardFocus, true, allowForeignWidgetToResizeComponent))
{
setOpaque (true);
}