b=521940 don't paint the plugin socket window to avoid flicker on load r=roc

--HG--
extra : rebase_source : 9a0f5cf10ecd3c939e6f13c14c9bcd88ace5d457
This commit is contained in:
Karl Tomlinson 2009-10-14 15:38:31 +13:00
parent a3c6852b14
commit 6f4fb3531e
2 changed files with 16 additions and 0 deletions

View File

@ -261,6 +261,13 @@ nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow() {
gtk_container_add(container, mSocketWidget);
gtk_widget_realize(mSocketWidget);
// The GtkSocket has a visible window, but the plugin's XEmbed plug will
// cover this window. Normally GtkSockets let the X server paint their
// background and this would happen immediately (before the plug is
// created). Setting the background to None prevents the server from
// painting this window, avoiding flicker.
gdk_window_set_back_pixmap(mSocketWidget->window, NULL, FALSE);
// Resize before we show
SetAllocation();

View File

@ -387,6 +387,15 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
if (user_data)
gtk_container_add(GTK_CONTAINER(user_data), GTK_WIDGET(xtbin));
/* This GtkSocket has a visible window, but the Xt plug will cover this
* window. Normally GtkSockets let the X server paint their background and
* this would happen immediately (before the plug is mapped). Setting the
* background to None prevents the server from painting this window,
* avoiding flicker.
*/
gtk_widget_realize(GTK_WIDGET(xtbin));
gdk_window_set_back_pixmap(GTK_WIDGET(xtbin)->window, NULL, FALSE);
return GTK_WIDGET (xtbin);
}