diff options
| author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-04-24 13:41:14 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-24 15:19:22 +0200 |
| commit | 34a0cc44e9b0d5a8c9c3ea7302d9ebc89270de94 (patch) | |
| tree | 06c229219291a29130230a343a698edd561a60d3 | |
| parent | c426b31a6c9e39b8a857a0590dae6c21738c7184 (diff) | |
| download | qtwebkit-34a0cc44e9b0d5a8c9c3ea7302d9ebc89270de94.tar.gz | |
Do not try to create invalid sized XPixmaps
If a visible plugin is resized to an empty size we request an empty
sized xpixmap which is illegal.
Instead hide and only free the exiting drawable.
Task-number: QTBUG-38541
Change-Id: I2cb3d221d656b1b18391c479168221bcd0aa73b1
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
| -rw-r--r-- | Source/WebCore/plugins/qt/PluginViewQt.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp index 94ef7eb7d..de06a2fea 100644 --- a/Source/WebCore/plugins/qt/PluginViewQt.cpp +++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp @@ -145,14 +145,20 @@ void PluginView::updatePluginWidget() // The plugin had a zero width or height before but was resized, we need to show it again. if (oldWindowRect.isEmpty()) show(); + if (m_windowRect.isEmpty()) + hide(); if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) { - if (m_drawable) + if (m_drawable) { XFreePixmap(x11Display(), m_drawable); + m_drawable = 0; + } - m_drawable = XCreatePixmap(x11Display(), rootWindowID(), m_windowRect.width(), m_windowRect.height(), - ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth); - syncX(); // make sure that the server knows about the Drawable + if (!m_windowRect.isEmpty()) { + m_drawable = XCreatePixmap(x11Display(), rootWindowID(), m_windowRect.width(), m_windowRect.height(), + ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth); + syncX(); // make sure that the server knows about the Drawable + } } // do not call setNPWindowIfNeeded immediately, will be called on paint() |
