summaryrefslogtreecommitdiffstats
path: root/WebCore/plugins/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/plugins/gtk')
-rw-r--r--WebCore/plugins/gtk/PluginViewGtk.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index dca7dad..78c6636 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -506,10 +506,10 @@ void PluginView::setNPWindowIfNeeded()
m_npWindow.width = m_windowRect.width();
m_npWindow.height = m_windowRect.height();
- m_npWindow.clipRect.left = m_clipRect.x();
- m_npWindow.clipRect.top = m_clipRect.y();
- m_npWindow.clipRect.right = m_clipRect.width();
- m_npWindow.clipRect.bottom = m_clipRect.height();
+ m_npWindow.clipRect.left = max(0, m_clipRect.x());
+ m_npWindow.clipRect.top = max(0, m_clipRect.y());
+ m_npWindow.clipRect.right = m_clipRect.x() + m_clipRect.width();
+ m_npWindow.clipRect.bottom = m_clipRect.y() + m_clipRect.height();
GtkAllocation allocation = { m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height() };
gtk_widget_size_allocate(platformPluginWidget(), &allocation);
@@ -522,6 +522,8 @@ void PluginView::setNPWindowIfNeeded()
} else {
m_npWindow.x = 0;
m_npWindow.y = 0;
+ m_npWindow.width = m_windowRect.width();
+ m_npWindow.height = m_windowRect.height();
m_npWindow.clipRect.left = 0;
m_npWindow.clipRect.top = 0;
@@ -529,13 +531,6 @@ void PluginView::setNPWindowIfNeeded()
m_npWindow.clipRect.bottom = 0;
}
- // FLASH WORKAROUND: Only set initially. Multiple calls to
- // setNPWindow() cause the plugin to crash in windowed mode.
- if (!m_isWindowed || m_npWindow.width == (unsigned int)-1 || m_npWindow.height == (unsigned int)-1) {
- m_npWindow.width = m_windowRect.width();
- m_npWindow.height = m_windowRect.height();
- }
-
PluginView::setCurrentPluginView(this);
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
setCallingPlugin(true);