From 9c58a59069826fffe287cbc69dd1ace156ba07b7 Mon Sep 17 00:00:00 2001 From: "bryner%netscape.com" Date: Mon, 3 Mar 2003 08:57:12 +0000 Subject: [PATCH] Consolidate gtk initialization to main(), which fixes inconsistencies with not calling gtk_set_locale(). We can do this now that we're not worrying about drop-in toolkit support. Bug 118478, patch by gelsoft@mx4.tiki.ne.jp, r=me, sr=blizzard. --- widget/src/gtk/nsAppShell.cpp | 8 -------- widget/src/gtk2/nsAppShell.cpp | 2 -- xpfe/bootstrap/nsAppRunner.cpp | 12 ++++++++---- xpfe/bootstrap/nsNativeAppSupportGtk.cpp | 2 -- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/widget/src/gtk/nsAppShell.cpp b/widget/src/gtk/nsAppShell.cpp index 43cb5f3eb2cf..f3b5a24647e9 100644 --- a/widget/src/gtk/nsAppShell.cpp +++ b/widget/src/gtk/nsAppShell.cpp @@ -238,14 +238,6 @@ NS_IMETHODIMP nsAppShell::Create(int *bac, char **bav) gdk_rgb_set_install(TRUE); } - gtk_set_locale (); - - gtk_init (&argc, &argv); - -#ifdef MOZ_GLE - gle_init (&argc, &argv); -#endif - gdk_rgb_init(); return NS_OK; diff --git a/widget/src/gtk2/nsAppShell.cpp b/widget/src/gtk2/nsAppShell.cpp index bfa803f24218..e4c67bf9cbcd 100644 --- a/widget/src/gtk2/nsAppShell.cpp +++ b/widget/src/gtk2/nsAppShell.cpp @@ -112,8 +112,6 @@ nsAppShell::Create(int *argc, char **argv) // XXX add all of the command line handling - gtk_init(argc, &argv); - #ifdef ACCESSIBILITY nsAccessibilityInterface::Init(); #endif diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 5b3d27ecac26..38d4b7c7fa9f 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -956,10 +956,6 @@ static void ShowOSAlertFromFile(int argc, char **argv, const char *alert_filenam } } - #if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2) - gtk_init(&argc, &argv); - #endif - ShowOSAlert(messageToShow); } @@ -1544,6 +1540,14 @@ int main(int argc, char* argv[]) InitializeMacOSXApp(argc, argv); #endif +#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2) + // Initialize GTK+1/2 here for splash +#if defined(MOZ_WIDGET_GTK) + gtk_set_locale(); +#endif + gtk_init(&argc, &argv); +#endif /* MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2 */ + #ifdef _BUILD_STATIC_BIN // Initialize XPCOM's module info table NSGetStaticModuleInfo = app_getModuleInfo; diff --git a/xpfe/bootstrap/nsNativeAppSupportGtk.cpp b/xpfe/bootstrap/nsNativeAppSupportGtk.cpp index 13ca16bcb85c..1e1c819e9487 100644 --- a/xpfe/bootstrap/nsNativeAppSupportGtk.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportGtk.cpp @@ -53,8 +53,6 @@ NS_IMPL_ISUPPORTS1(nsSplashScreenGtk, nsISplashScreen) nsSplashScreenGtk::nsSplashScreenGtk() { - // if this fails, we exit - gdk_init(0, NULL); } nsSplashScreenGtk::~nsSplashScreenGtk()