Merge backout of bug 460926
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 15 Dec 2008 09:21:17 -0500
changeset 22808 9bc6733d81ccf3e384414097ddfab90443a2a1d5
parent 22806 b858eeb64326866d9561474bdbab77c2805c6232 (current diff)
parent 22807 3cbb1961f1f7047554228cbae0629112ffeaf5f5 (diff)
child 22809 107fb0f79d87d555c42a833f3f27e01b37643910
push id4190
push userbsmedberg@mozilla.com
push dateMon, 15 Dec 2008 14:21:49 +0000
treeherdermozilla-central@9bc6733d81cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs460926
milestone1.9.2a1pre
Merge backout of bug 460926
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2520,16 +2520,30 @@ XRE_main(int argc, char* argv[], const n
   _set_sbh_threshold(0);
 #endif
 #endif
 
 #if defined(XP_UNIX) || defined(XP_BEOS)
   InstallUnixSignalHandlers(argv[0]);
 #endif
 
+#ifdef MOZ_ACCESSIBILITY_ATK
+  // Reset GTK_MODULES, strip atk-bridge if exists
+  // Mozilla will load libatk-bridge.so later if necessary
+  const char* gtkModules = PR_GetEnv("GTK_MODULES");
+  if (gtkModules && *gtkModules) {
+    nsCString gtkModulesStr(gtkModules);
+    gtkModulesStr.ReplaceSubstring("atk-bridge", "");
+    char* expr = PR_smprintf("GTK_MODULES=%s", gtkModulesStr.get());
+    if (expr)
+      PR_SetEnv(expr);
+    // We intentionally leak |expr| here since it is required by PR_SetEnv.
+  }
+#endif
+
 #ifndef WINCE
   // Unbuffer stdout, needed for tinderbox tests.
   setbuf(stdout, 0);
 #endif
 
 #if defined(FREEBSD)
   // Disable all SIGFPE's on FreeBSD, as it has non-IEEE-conformant fp
   // trap behavior that trips up on floating-point tests performed by
@@ -2912,44 +2926,16 @@ XRE_main(int argc, char* argv[], const n
 
 #if defined(MOZ_WIDGET_GTK2)
     GdkDisplay* display = nsnull;
     display = gdk_display_open(display_name);
     if (!display) {
       PR_fprintf(PR_STDERR, "Error: cannot open display: %s\n", display_name);
       return 1;
     }
-
-#ifdef MOZ_ACCESSIBILITY_ATK
-    // Reset GTK_MODULES, strip atk-bridge if exists
-    // Mozilla will load libatk-bridge.so later if necessary
-    const char* gtkModules = PR_GetEnv("GTK_MODULES");
-    if (gtkModules && *gtkModules) {
-      nsCString gtkModulesStr(gtkModules);
-      gtkModulesStr.ReplaceSubstring("atk-bridge", "");
-      char* expr = PR_smprintf("GTK_MODULES=%s", gtkModulesStr.get());
-      if (expr)
-        PR_SetEnv(expr);
-      // We intentionally leak |expr| here since it is required by PR_SetEnv.
-    }
-
-    // Reset gtk-modules setting from gtk settings, strip atk-bridge if exists
-    // Mozilla will load libatk-bridge.so later if necessary
-    GtkSettings* settings =
-      gtk_settings_get_for_screen(gdk_display_get_default_screen(display));
-    gchar* gtk_modules_setting = nsnull;
-    g_object_get(settings, "gtk-modules", &gtk_modules_setting, NULL);
-    if (gtk_modules_setting) {
-      nsCString gtkModulesSettingStr(gtkModules);
-      gtkModulesSettingStr.ReplaceSubstring("atk-bridge", "");
-      g_object_set(settings, "gtk-modules", gtkModulesSettingStr.get(), NULL);
-      g_free(gtk_modules_setting);
-    }
-#endif
-
     gdk_display_manager_set_default_display (gdk_display_manager_get(),
                                              display);
     
     // g_set_application_name () is only defined in glib2.2 and higher.
     _g_set_application_name_fn _g_set_application_name =
       (_g_set_application_name_fn)FindFunction("g_set_application_name");
     if (_g_set_application_name) {
       _g_set_application_name(gAppData->name);