Commit 74eb6efc authored by xan@webkit.org's avatar xan@webkit.org

2010-02-25 Xan Lopez <xlopez@igalia.com>

        Reviewed by Gustavo Noronha.

        Workaround Java plugins not drawing themselves properly on first
        expose by doing a late size-allocate after 'plug-added' has been
        emitted on the embedding GtkSocket. It's unclear to me if this is
        a bug in our side or theirs, but this should be pretty safe and
        fixes the annoyance while we investigate it further.

        * plugins/gtk/PluginViewGtk.cpp:
        (WebCore::plugAddedCallback):
        (WebCore::PluginView::platformStart):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55238 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5de927ac
2010-02-25 Xan Lopez <xlopez@igalia.com>
Reviewed by Gustavo Noronha.
Workaround Java plugins not drawing themselves properly on first
expose by doing a late size-allocate after 'plug-added' has been
emitted on the embedding GtkSocket. It's unclear to me if this is
a bug in our side or theirs, but this should be pretty safe and
fixes the annoyance while we investigate it further.
* plugins/gtk/PluginViewGtk.cpp:
(WebCore::plugAddedCallback):
(WebCore::PluginView::platformStart):
2010-02-23 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Tor Arne Vestbø.
......
......@@ -797,6 +797,22 @@ static void getVisualAndColormap(int depth, Visual** visual, Colormap* colormap)
}
#endif
void plugAddedCallback(GtkSocket* socket, PluginView* view)
{
if (!socket || !view)
return;
// FIXME: Java Plugins do not seem to draw themselves properly the
// first time unless we do a size-allocate after they have done
// the plug operation on their side, which in general does not
// happen since we do size-allocates before setting the
// NPWindow. Apply this workaround until we figure out a better
// solution, if any.
IntRect rect = view->frameRect();
GtkAllocation allocation = { rect.x(), rect.y(), rect.width(), rect.height() };
gtk_widget_size_allocate(GTK_WIDGET(socket), &allocation);
}
bool PluginView::platformStart()
{
ASSERT(m_isStarted);
......@@ -816,6 +832,7 @@ bool PluginView::platformStart()
if (m_needsXEmbed) {
setPlatformWidget(gtk_socket_new());
gtk_container_add(GTK_CONTAINER(m_parentFrame->view()->hostWindow()->platformPageClient()), platformPluginWidget());
g_signal_connect(platformPluginWidget(), "plug-added", G_CALLBACK(plugAddedCallback), this);
g_signal_connect(platformPluginWidget(), "plug_removed", G_CALLBACK(plug_removed_cb), NULL);
} else
setPlatformWidget(gtk_xtbin_new(m_parentFrame->view()->hostWindow()->platformPageClient()->window, 0));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment