From 67509cc334a363e27e36207c5e66cce22f6ffc82 Mon Sep 17 00:00:00 2001 From: "ginn.chen%sun.com" Date: Mon, 13 Feb 2006 06:04:10 +0000 Subject: [PATCH] Bug 312092 Accessible hierarchy incomplete/incorrect r=benjamin sr=neil --- build/unix/run-mozilla.sh | 6 ------ toolkit/xre/nsAppRunner.cpp | 12 ++++++++++++ xpfe/bootstrap/nsAppRunner.cpp | 12 ++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/build/unix/run-mozilla.sh b/build/unix/run-mozilla.sh index 029d4fb7368..9e3eec160fd 100755 --- a/build/unix/run-mozilla.sh +++ b/build/unix/run-mozilla.sh @@ -161,12 +161,6 @@ moz_run_program() fi fi ## - ## Reset GTK_MODULES, strip atk-bridge if exists - ## Mozilla will load libatk-bridge.so later if necessary - ## - GTK_MODULES=`echo $GTK_MODULES | sed -e 's/atk-bridge//g'` - export GTK_MODULES - ## ## Run the program ## "$prog" ${1+"$@"} diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 097b8825b48..b73f213c5f3 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -1877,6 +1877,18 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) 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 = getenv("GTK_MODULES"); + if (gtkModules) { + nsCString gtkModulesStr(gtkModules); + gtkModulesStr.ReplaceSubstring("atk-bridge", ""); + char* newGtkModules = strdup(gtkModulesStr.get()); + setenv("GTK_MODULES", newGtkModules, 1); + } +#endif + // Unbuffer stdout, needed for tinderbox tests. setbuf(stdout, 0); diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 049df98f84e..dfcbe12c504 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -1566,6 +1566,18 @@ int main(int argc, char* argv[]) 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 = getenv("GTK_MODULES"); + if (gtkModules) { + nsCString gtkModulesStr(gtkModules); + gtkModulesStr.ReplaceSubstring("atk-bridge", ""); + char* newGtkModules = strdup(gtkModulesStr.get()); + setenv("GTK_MODULES", newGtkModules, 1); + } +#endif + #if defined(XP_OS2) __pargc = &argc; __argv = argv;