author | Wolfgang Rosenauer <wr@rosenauer.org> |
Mon, 11 Jan 2010 23:34:40 +0100 | |
changeset 49 | 18b77ae68610 |
parent 22 | 28fc3b05b018 |
child 64 | 7bb1edb78dd5 |
permissions | -rw-r--r-- |
22
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
1 |
From: Lubos Lunak <llunak@suse.cz>, Ginn Chen <ginn.chen@sun.com> |
8 | 2 |
Subject: Firefox 3.5 broken startup notification |
3 |
References: |
|
4 |
http://bugzilla.novell.com/show_bug.cgi?id=518603 |
|
5 |
https://bugzilla.mozilla.org/show_bug.cgi?id=416053 |
|
22
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
6 |
https://bugzilla.mozilla.org/show_bug.cgi?id=534845 |
8 | 7 |
|
1 | 8 |
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp |
9 |
--- a/toolkit/xre/nsAppRunner.cpp |
|
10 |
+++ b/toolkit/xre/nsAppRunner.cpp |
|
22
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
11 |
@@ -3370,23 +3370,16 @@ XRE_main(int argc, char* argv[], const n |
1 | 12 |
} |
13 |
dirProvider.DoStartup(); |
|
14 |
||
15 |
PRBool shuttingDown = PR_FALSE; |
|
16 |
appStartup->GetShuttingDown(&shuttingDown); |
|
17 |
||
18 |
nsCOMPtr<nsICommandLineRunner> cmdLine; |
|
19 |
||
20 |
-#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2) |
|
21 |
- nsRefPtr<nsGTKToolkit> toolkit = GetGTKToolkit(); |
|
22 |
- if (toolkit && !desktopStartupID.IsEmpty()) { |
|
23 |
- toolkit->SetDesktopStartupID(desktopStartupID); |
|
24 |
- } |
|
25 |
-#endif |
|
26 |
- |
|
27 |
nsCOMPtr<nsIFile> workingDir; |
|
28 |
rv = NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir)); |
|
29 |
NS_ENSURE_SUCCESS(rv, 1); |
|
30 |
||
31 |
if (!shuttingDown) { |
|
32 |
cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1"); |
|
33 |
NS_ENSURE_TRUE(cmdLine, 1); |
|
34 |
||
22
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
35 |
@@ -3404,16 +3397,23 @@ XRE_main(int argc, char* argv[], const n |
1 | 36 |
|
37 |
NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow"); |
|
38 |
rv = appStartup->CreateHiddenWindow(); |
|
39 |
NS_TIMELINE_LEAVE("appStartup->CreateHiddenWindow"); |
|
40 |
NS_ENSURE_SUCCESS(rv, 1); |
|
41 |
||
42 |
MOZ_SPLASHSCREEN_UPDATE(50); |
|
43 |
||
44 |
+#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2) |
|
45 |
+ nsRefPtr<nsGTKToolkit> toolkit = GetGTKToolkit(); |
|
46 |
+ if (toolkit && !desktopStartupID.IsEmpty()) { |
|
47 |
+ toolkit->SetDesktopStartupID(desktopStartupID); |
|
48 |
+ } |
|
49 |
+#endif |
|
50 |
+ |
|
51 |
// Extension Compatibility Checking and Startup |
|
52 |
if (gAppData->flags & NS_XRE_ENABLE_EXTENSION_MANAGER) { |
|
53 |
nsCOMPtr<nsIExtensionManager> em(do_GetService("@mozilla.org/extensions/manager;1")); |
|
54 |
NS_ENSURE_TRUE(em, 1); |
|
55 |
||
56 |
if (upgraded) { |
|
57 |
rv = em->CheckForMismatches(&needsRestart); |
|
58 |
if (NS_FAILED(rv)) { |
|
22
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
59 |
@@ -3581,30 +3581,23 @@ XRE_main(int argc, char* argv[], const n |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
60 |
#ifdef XP_MACOSX |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
61 |
if (gBinaryPath) { |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
62 |
static char kEnvVar[MAXPATHLEN]; |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
63 |
sprintf(kEnvVar, "XRE_BINARY_PATH=%s", gBinaryPath); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
64 |
PR_SetEnv(kEnvVar); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
65 |
} |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
66 |
#endif |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
67 |
|
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
68 |
-// XXXkt s/MOZ_TOOLKIT_GTK2/MOZ_WIDGET_GTK2/? |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
69 |
-// but the hidden window has been destroyed so toolkit is NULL anyway. |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
70 |
-#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_TOOLKIT_GTK2) |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
71 |
- nsGTKToolkit* toolkit = GetGTKToolkit(); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
72 |
- if (toolkit) { |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
73 |
- nsCAutoString currentDesktopStartupID; |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
74 |
- toolkit->GetDesktopStartupID(¤tDesktopStartupID); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
75 |
- if (!currentDesktopStartupID.IsEmpty()) { |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
76 |
- nsCAutoString desktopStartupEnv; |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
77 |
- desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
78 |
- desktopStartupEnv.Append(currentDesktopStartupID); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
79 |
- // Leak it with extreme prejudice! |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
80 |
- PR_SetEnv(ToNewCString(desktopStartupEnv)); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
81 |
- } |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
82 |
+#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2) |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
83 |
+ if (!desktopStartupID.IsEmpty()) { |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
84 |
+ nsCAutoString desktopStartupEnv; |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
85 |
+ desktopStartupEnv.AssignLiteral("DESKTOP_STARTUP_ID="); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
86 |
+ desktopStartupEnv.Append(desktopStartupID); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
87 |
+ // Leak it with extreme prejudice! |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
88 |
+ PR_SetEnv(ToNewCString(desktopStartupEnv)); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
89 |
} |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
90 |
#endif |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
91 |
|
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
92 |
#ifdef MOZ_WIDGET_GTK2 |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
93 |
MOZ_gdk_display_close(display); |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
94 |
#endif |
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
95 |
|
28fc3b05b018
Incorporated another startup notification fix (bmo#534845)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
8
diff
changeset
|
96 |
rv = LaunchChild(nativeApp, appInitiatedRestart); |