зеркало из https://github.com/mozilla/pjs.git
Fix bug #91640. Make sure to check the offscreen window before destroying it. Also so other related cleanup. Original patch from Andrew Chatham. r/sr=blizzard,tor.
This commit is contained in:
Родитель
90dcc96f3b
Коммит
508b4794fb
|
@ -168,8 +168,7 @@ EmbedPrivate::Realize(PRBool *aAlreadyRealized)
|
|||
*aAlreadyRealized = PR_FALSE;
|
||||
|
||||
// create the offscreen window if we have to
|
||||
if (!sOffscreenWindow)
|
||||
CreateOffscreenWindow();
|
||||
EnsureOffscreenWindow();
|
||||
|
||||
// Have we ever been initialized before? If so then just reparetn
|
||||
// from the offscreen window.
|
||||
|
@ -786,8 +785,10 @@ EmbedPrivate::ShutdownProfile(void)
|
|||
|
||||
/* static */
|
||||
void
|
||||
EmbedPrivate::CreateOffscreenWindow(void)
|
||||
EmbedPrivate::EnsureOffscreenWindow(void)
|
||||
{
|
||||
if (sOffscreenWindow)
|
||||
return;
|
||||
sOffscreenWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_widget_realize(sOffscreenWindow);
|
||||
sOffscreenFixed = gtk_fixed_new();
|
||||
|
@ -799,6 +800,8 @@ EmbedPrivate::CreateOffscreenWindow(void)
|
|||
void
|
||||
EmbedPrivate::DestroyOffscreenWindow(void)
|
||||
{
|
||||
if (!sOffscreenWindow)
|
||||
return;
|
||||
gtk_widget_destroy(sOffscreenWindow);
|
||||
sOffscreenWindow = 0;
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ class EmbedPrivate {
|
|||
static void ShutdownProfile(void);
|
||||
|
||||
// offscreen window methods and the offscreen widget
|
||||
static void CreateOffscreenWindow(void);
|
||||
static void EnsureOffscreenWindow(void);
|
||||
static void DestroyOffscreenWindow(void);
|
||||
static GtkWidget *sOffscreenWindow;
|
||||
static GtkWidget *sOffscreenFixed;
|
||||
|
|
Загрузка…
Ссылка в новой задаче