diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index d0cf7959612..6adb483fd04 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -704,7 +704,7 @@ nsWindow::SetFocus(PRBool aRaise) // Set focus to the window if (gRaiseWindows && aRaise && toplevelWidget && !GTK_WIDGET_HAS_FOCUS(toplevelWidget) && - !mNeedsResize) + !mNeedsResize && GTK_IS_WINDOW(owningWindow->mShell)) gtk_window_present(GTK_WINDOW(owningWindow->mShell)); gtk_widget_grab_focus(owningWidget);