Bug 591216 Fix Gtk-WARNING gtk_window_set_wmclass: shouldn't set wmclass after window is realized r=roc a=roc

This commit is contained in:
Ginn Chen 2010-09-02 15:23:52 +08:00
parent 76c7838dc0
commit 612fb82a7b

View File

@ -3777,11 +3777,12 @@ nsWindow::Create(nsIWidget *aParent,
// GTK_WINDOW_POPUP, which will use a Window with the
// override-redirect attribute (for temporary windows).
mShell = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Popup", cBrand.get());
} else {
// For long-lived windows, their stacking order is managed by
// the window manager, as indicated by GTK_WINDOW_TOPLEVEL ...
mShell = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWindow* gtkWin = GTK_WINDOW(mShell);
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Popup", cBrand.get());
// ... but the window manager does not decorate this window,
// nor provide a separate taskbar icon.
if (mBorderStyle == eBorderStyle_default) {
@ -3794,11 +3795,11 @@ nsWindow::Create(nsIWidget *aParent,
gtk_window_set_deletable(GTK_WINDOW(mShell), mBorderStyle & eBorderStyle_close);
}
}
gtk_window_set_skip_taskbar_hint(gtkWin, TRUE);
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mShell), TRUE);
// Element focus is managed by the parent window so the
// WM_HINTS input field is set to False to tell the window
// manager not to set input focus to this window ...
gtk_window_set_accept_focus(gtkWin, FALSE);
gtk_window_set_accept_focus(GTK_WINDOW(mShell), FALSE);
#ifdef MOZ_X11
// ... but when the window manager offers focus through
// WM_TAKE_FOCUS, focus is requested on the parent window.
@ -3808,8 +3809,6 @@ nsWindow::Create(nsIWidget *aParent,
#endif
}
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Popup", cBrand.get());
GdkWindowTypeHint gtkTypeHint;
switch (aInitData->mPopupHint) {
case ePopupTypeMenu: