# HG changeset patch # User Wolfgang Rosenauer # Date 1260902401 -3600 # Node ID 28fc3b05b018f467a3ceb138f175a014270faaef # Parent 5b8b22d50d90b105aa77bbdde574d4e1b7582c03 Incorporated another startup notification fix (bmo#534845) diff -r 5b8b22d50d90 -r 28fc3b05b018 mozilla-startup-notification.patch --- a/mozilla-startup-notification.patch Tue Dec 15 19:26:24 2009 +0100 +++ b/mozilla-startup-notification.patch Tue Dec 15 19:40:01 2009 +0100 @@ -1,13 +1,14 @@ -From: Lubos Lunak +From: Lubos Lunak , Ginn Chen Subject: Firefox 3.5 broken startup notification References: http://bugzilla.novell.com/show_bug.cgi?id=518603 https://bugzilla.mozilla.org/show_bug.cgi?id=416053 +https://bugzilla.mozilla.org/show_bug.cgi?id=534845 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp -@@ -3342,23 +3342,16 @@ XRE_main(int argc, char* argv[], const n +@@ -3370,23 +3370,16 @@ XRE_main(int argc, char* argv[], const n } dirProvider.DoStartup(); @@ -31,7 +32,7 @@ cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1"); NS_ENSURE_TRUE(cmdLine, 1); -@@ -3376,16 +3369,23 @@ XRE_main(int argc, char* argv[], const n +@@ -3404,16 +3397,23 @@ XRE_main(int argc, char* argv[], const n NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow"); rv = appStartup->CreateHiddenWindow(); @@ -55,3 +56,41 @@ if (upgraded) { rv = em->CheckForMismatches(&needsRestart); if (NS_FAILED(rv)) { +@@ -3581,30 +3581,23 @@ XRE_main(int argc, char* argv[], const n + #ifdef XP_MACOSX + if (gBinaryPath) { + static char kEnvVar[MAXPATHLEN]; + sprintf(kEnvVar, "XRE_BINARY_PATH=%s", gBinaryPath); + PR_SetEnv(kEnvVar); + } + #endif + +-// XXXkt s/MOZ_TOOLKIT_GTK2/MOZ_WIDGET_GTK2/? +-// but the hidden window has been destroyed so toolkit is NULL anyway. +-#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_TOOLKIT_GTK2) +- nsGTKToolkit* toolkit = GetGTKToolkit(); +- if (toolkit) { +- nsCAutoString currentDesktopStartupID; +- toolkit->GetDesktopStartupID(¤tDesktopStartupID); +- if (!currentDesktopStartupID.IsEmpty()) { +- nsCAutoString desktopStartupEnv; +- desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); +- desktopStartupEnv.Append(currentDesktopStartupID); +- // Leak it with extreme prejudice! +- PR_SetEnv(ToNewCString(desktopStartupEnv)); +- } ++#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2) ++ if (!desktopStartupID.IsEmpty()) { ++ nsCAutoString desktopStartupEnv; ++ desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); ++ desktopStartupEnv.Append(desktopStartupID); ++ // Leak it with extreme prejudice! ++ PR_SetEnv(ToNewCString(desktopStartupEnv)); + } + #endif + + #ifdef MOZ_WIDGET_GTK2 + MOZ_gdk_display_close(display); + #endif + + rv = LaunchChild(nativeApp, appInitiatedRestart);