mozilla-startup-notification.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Sat, 19 Dec 2009 22:03:52 +0100
changeset 26 bfb0e78e1a7d
parent 22 28fc3b05b018
child 64 7bb1edb78dd5
permissions -rw-r--r--
Prepare firefox-ui-lockdown patch for integration
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
19a8c8d53349 Fixed patch comments
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1
diff changeset
     2
Subject: Firefox 3.5 broken startup notification
19a8c8d53349 Fixed patch comments
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1
diff changeset
     3
References:
19a8c8d53349 Fixed patch comments
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1
diff changeset
     4
http://bugzilla.novell.com/show_bug.cgi?id=518603
19a8c8d53349 Fixed patch comments
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1
diff changeset
     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
19a8c8d53349 Fixed patch comments
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1
diff changeset
     7
1
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
--- a/toolkit/xre/nsAppRunner.cpp
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    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
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    12
         }
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    13
         dirProvider.DoStartup();
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
         PRBool shuttingDown = PR_FALSE;
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
         appStartup->GetShuttingDown(&shuttingDown);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
         nsCOMPtr<nsICommandLineRunner> cmdLine;
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
-#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2)
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
-        nsRefPtr<nsGTKToolkit> toolkit = GetGTKToolkit();
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
-        if (toolkit && !desktopStartupID.IsEmpty()) {
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
-          toolkit->SetDesktopStartupID(desktopStartupID);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
-        }
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
-#endif
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
-
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
         nsCOMPtr<nsIFile> workingDir;
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    28
         rv = NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir));
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    29
         NS_ENSURE_SUCCESS(rv, 1);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    30
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    31
         if (!shuttingDown) {
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    32
           cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1");
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    33
           NS_ENSURE_TRUE(cmdLine, 1);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    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
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    36
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    37
           NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow");
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    38
           rv = appStartup->CreateHiddenWindow();
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    39
           NS_TIMELINE_LEAVE("appStartup->CreateHiddenWindow");
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    40
           NS_ENSURE_SUCCESS(rv, 1);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    42
           MOZ_SPLASHSCREEN_UPDATE(50);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    43
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    44
+#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2)
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    45
+          nsRefPtr<nsGTKToolkit> toolkit = GetGTKToolkit();
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    46
+          if (toolkit && !desktopStartupID.IsEmpty()) {
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
+            toolkit->SetDesktopStartupID(desktopStartupID);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
+          }
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
+#endif
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
+
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    51
           // Extension Compatibility Checking and Startup
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    52
           if (gAppData->flags & NS_XRE_ENABLE_EXTENSION_MANAGER) {
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    53
             nsCOMPtr<nsIExtensionManager> em(do_GetService("@mozilla.org/extensions/manager;1"));
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    54
             NS_ENSURE_TRUE(em, 1);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    55
 
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    56
             if (upgraded) {
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    57
               rv = em->CheckForMismatches(&needsRestart);
045edd78eceb Add missing files
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    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(&currentDesktopStartupID);
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);