1 From: Lubos Lunak <llunak@suse.cz> |
1 From: Lubos Lunak <llunak@suse.cz>, Ginn Chen <ginn.chen@sun.com> |
2 Subject: Firefox 3.5 broken startup notification |
2 Subject: Firefox 3.5 broken startup notification |
3 References: |
3 References: |
4 http://bugzilla.novell.com/show_bug.cgi?id=518603 |
4 http://bugzilla.novell.com/show_bug.cgi?id=518603 |
5 https://bugzilla.mozilla.org/show_bug.cgi?id=416053 |
5 https://bugzilla.mozilla.org/show_bug.cgi?id=416053 |
|
6 https://bugzilla.mozilla.org/show_bug.cgi?id=534845 |
6 |
7 |
7 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp |
8 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp |
8 --- a/toolkit/xre/nsAppRunner.cpp |
9 --- a/toolkit/xre/nsAppRunner.cpp |
9 +++ b/toolkit/xre/nsAppRunner.cpp |
10 +++ b/toolkit/xre/nsAppRunner.cpp |
10 @@ -3342,23 +3342,16 @@ XRE_main(int argc, char* argv[], const n |
11 @@ -3370,23 +3370,16 @@ XRE_main(int argc, char* argv[], const n |
11 } |
12 } |
12 dirProvider.DoStartup(); |
13 dirProvider.DoStartup(); |
13 |
14 |
14 PRBool shuttingDown = PR_FALSE; |
15 PRBool shuttingDown = PR_FALSE; |
15 appStartup->GetShuttingDown(&shuttingDown); |
16 appStartup->GetShuttingDown(&shuttingDown); |
29 |
30 |
30 if (!shuttingDown) { |
31 if (!shuttingDown) { |
31 cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1"); |
32 cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1"); |
32 NS_ENSURE_TRUE(cmdLine, 1); |
33 NS_ENSURE_TRUE(cmdLine, 1); |
33 |
34 |
34 @@ -3376,16 +3369,23 @@ XRE_main(int argc, char* argv[], const n |
35 @@ -3404,16 +3397,23 @@ XRE_main(int argc, char* argv[], const n |
35 |
36 |
36 NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow"); |
37 NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow"); |
37 rv = appStartup->CreateHiddenWindow(); |
38 rv = appStartup->CreateHiddenWindow(); |
38 NS_TIMELINE_LEAVE("appStartup->CreateHiddenWindow"); |
39 NS_TIMELINE_LEAVE("appStartup->CreateHiddenWindow"); |
39 NS_ENSURE_SUCCESS(rv, 1); |
40 NS_ENSURE_SUCCESS(rv, 1); |
53 NS_ENSURE_TRUE(em, 1); |
54 NS_ENSURE_TRUE(em, 1); |
54 |
55 |
55 if (upgraded) { |
56 if (upgraded) { |
56 rv = em->CheckForMismatches(&needsRestart); |
57 rv = em->CheckForMismatches(&needsRestart); |
57 if (NS_FAILED(rv)) { |
58 if (NS_FAILED(rv)) { |
|
59 @@ -3581,30 +3581,23 @@ XRE_main(int argc, char* argv[], const n |
|
60 #ifdef XP_MACOSX |
|
61 if (gBinaryPath) { |
|
62 static char kEnvVar[MAXPATHLEN]; |
|
63 sprintf(kEnvVar, "XRE_BINARY_PATH=%s", gBinaryPath); |
|
64 PR_SetEnv(kEnvVar); |
|
65 } |
|
66 #endif |
|
67 |
|
68 -// XXXkt s/MOZ_TOOLKIT_GTK2/MOZ_WIDGET_GTK2/? |
|
69 -// but the hidden window has been destroyed so toolkit is NULL anyway. |
|
70 -#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_TOOLKIT_GTK2) |
|
71 - nsGTKToolkit* toolkit = GetGTKToolkit(); |
|
72 - if (toolkit) { |
|
73 - nsCAutoString currentDesktopStartupID; |
|
74 - toolkit->GetDesktopStartupID(¤tDesktopStartupID); |
|
75 - if (!currentDesktopStartupID.IsEmpty()) { |
|
76 - nsCAutoString desktopStartupEnv; |
|
77 - desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); |
|
78 - desktopStartupEnv.Append(currentDesktopStartupID); |
|
79 - // Leak it with extreme prejudice! |
|
80 - PR_SetEnv(ToNewCString(desktopStartupEnv)); |
|
81 - } |
|
82 +#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2) |
|
83 + if (!desktopStartupID.IsEmpty()) { |
|
84 + nsCAutoString desktopStartupEnv; |
|
85 + desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); |
|
86 + desktopStartupEnv.Append(desktopStartupID); |
|
87 + // Leak it with extreme prejudice! |
|
88 + PR_SetEnv(ToNewCString(desktopStartupEnv)); |
|
89 } |
|
90 #endif |
|
91 |
|
92 #ifdef MOZ_WIDGET_GTK2 |
|
93 MOZ_gdk_display_close(display); |
|
94 #endif |
|
95 |
|
96 rv = LaunchChild(nativeApp, appInitiatedRestart); |