? mkinstalldirs
? notes.txt
? stamp-h1
? typo-fix.patch
Index: src/terminal-screen.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.c,v
retrieving revision 1.94
diff -p -u -r1.94 terminal-screen.c
--- src/terminal-screen.c	28 Jun 2004 07:44:02 -0000	1.94
+++ src/terminal-screen.c	27 Aug 2004 22:23:36 -0000
@@ -1158,7 +1158,7 @@ new_window_callback (GtkWidget      *men
                              terminal_profile_get_for_new_term (screen->priv->profile),
                              NULL,
                              FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0,
-                             NULL, name, -1);
+                             NULL, NULL, name, -1);
 
   g_free (name);
 }
@@ -1175,7 +1175,7 @@ new_tab_callback (GtkWidget      *menu_i
                              terminal_profile_get_for_new_term (screen->priv->profile),
                              screen->priv->window,
                              FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0,
-                             NULL, NULL, -1);
+                             NULL, NULL, NULL, -1);
 }
 
 static void
Index: src/terminal-window.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-window.c,v
retrieving revision 1.96
diff -p -u -r1.96 terminal-window.c
--- src/terminal-window.c	6 Aug 2004 06:27:44 -0000	1.96
+++ src/terminal-window.c	27 Aug 2004 22:23:37 -0000
@@ -1147,7 +1147,8 @@ terminal_window_show (GtkWidget *widget)
       
       context = sn_launchee_context_new (sn_display,
                                          gdk_screen_get_number (screen),
-                                         window->priv->startup_id);
+                                         window->priv->startup_id,
+                                         NULL);
       sn_launchee_context_setup_window (context,
                                         GDK_WINDOW_XWINDOW (widget->window));
     }
@@ -2231,7 +2232,7 @@ new_window_callback (GtkWidget      *men
                                  profile,
                                  NULL,
                                  FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0,
-                                 NULL, name, -1);
+                                 NULL, NULL, name, -1);
 
       g_free (name);
     }
@@ -2258,7 +2259,7 @@ new_tab_callback (GtkWidget      *menuit
                                  profile,
                                  window,
                                  FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0,
-                                 NULL, NULL, -1);
+                                 NULL, NULL, NULL, -1);
     }
 }
 
Index: src/terminal.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal.c,v
retrieving revision 1.76
diff -p -u -r1.76 terminal.c
--- src/terminal.c	26 Apr 2004 05:46:24 -0000	1.76
+++ src/terminal.c	27 Aug 2004 22:23:37 -0000
@@ -41,7 +41,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
-#include <gdk/gdkx.h>
+#include <X11/Xatom.h>
 
 
 /* Settings storage works as follows:
@@ -90,6 +90,7 @@ static GSList *pending_new_terminal_even
 typedef struct
 {
   char *startup_id;
+  Time *startup_timestamp;
   char *display_name;
   int screen_number;
   GList *initial_windows;
@@ -159,6 +160,7 @@ enum {
   OPTION_DISABLE_FACTORY,
   OPTION_USE_FACTORY,
   OPTION_STARTUP_ID,
+  OPTION_STARTUP_TIMESTAMP,
   OPTION_TITLE,
   OPTION_WORKING_DIRECTORY,
   OPTION_DEFAULT_WORKING_DIRECTORY,
@@ -314,6 +316,15 @@ struct poptOption options[] = {  
     NULL
   },
   {
+    "startup-timestamp",
+    '\0',
+    POPT_ARG_STRING,
+    NULL,
+    OPTION_STARTUP_TIMESTAMP,
+    N_("TIMESTAMP from startup notification protocol."),
+    NULL
+  },
+  {
     "title",
     't',
     POPT_ARG_STRING,
@@ -1143,6 +1154,26 @@ parse_options_callback (poptContext     
         }
       break;
       
+    case OPTION_STARTUP_TIMESTAMP:
+      if (results->startup_timestamp != NULL)
+        {
+          g_printerr (_("\"%s\" option given twice\n"), "--startup-timestamp");
+          exit (1);
+        }
+      else if (arg == NULL)
+        {
+          g_printerr (_("\"%s\" option requires an argument\n"), "--startup-timestamp");
+          exit (1);
+        }
+      else
+        {
+          Time timestamp;
+          timestamp = strtoul (arg, NULL, 10);
+          results->startup_timestamp = g_new (Time, 1);
+          *results->startup_timestamp = timestamp;
+        }
+      break;
+      
     case OPTION_LAST:
       g_assert_not_reached ();
       break;
@@ -1164,6 +1195,7 @@ option_parsing_results_free (OptionParsi
 
   g_free (results->display_name);
   g_free (results->startup_id);
+  g_free (results->startup_timestamp);
   
   g_free (results);
 }
@@ -1409,6 +1441,7 @@ new_terminal_with_options (OptionParsing
                                          it->zoom_set ?
                                          it->zoom : 1.0,
                                          results->startup_id,
+                                         results->startup_timestamp,
                                          results->display_name,
                                          results->screen_number);
 
@@ -1427,7 +1460,7 @@ new_terminal_with_options (OptionParsing
                                          NULL,
                                          it->zoom_set ?
                                          it->zoom : 1.0,
-                                         NULL, NULL, -1);
+                                         NULL, NULL, NULL, -1);
             }
           
           if (it->active)
@@ -1486,6 +1519,7 @@ main (int argc, char **argv)
   char **argv_copy;
   const char **args;
   const char *startup_id;
+  const char *startup_timestamp_str;
   const char *display_name;
   GdkDisplay *display;
   GnomeModuleRequirement reqs[] = {
@@ -1518,8 +1552,8 @@ main (int argc, char **argv)
   g_set_application_name (_("Terminal"));
   
   argc_copy = argc;
-  /* we leave empty slots, for --startup-id, --display and --default-working-directory */
-  argv_copy = g_new0 (char *, argc_copy + 7);
+  /* we leave empty slots, for --startup-id, --startup-timestamp, --display and --default-working-directory */
+  argv_copy = g_new0 (char *, argc_copy + 9);
   for (i = 0; i < argc_copy; i++)
     argv_copy [i] = g_strdup (argv [i]);
   argv_copy [i] = NULL;
@@ -1532,6 +1566,16 @@ main (int argc, char **argv)
       putenv ("DESKTOP_STARTUP_ID=");
     }
   
+  startup_timestamp_str = g_getenv ("DESKTOP_STARTUP_TIMESTAMP");
+  if (startup_timestamp_str != NULL  &&
+      *startup_timestamp_str != '\0' &&
+      results->startup_id != NULL)
+    {
+      results->startup_timestamp = g_new (Time, 1);
+      *results->startup_timestamp = strtoul (startup_timestamp_str, NULL, 10);
+      putenv ("DESKTOP_STARTUP_TIMESTAMP=");
+    }
+
   gtk_window_set_auto_startup_notification (FALSE); /* we'll do it ourselves due
                                                      * to complicated factory setup
                                                      */
@@ -1584,6 +1628,16 @@ main (int argc, char **argv)
                        "--startup-id", results->startup_id);
         }
 
+      if (results->startup_timestamp != NULL)
+        {
+          char timestampbuf[32];
+          sprintf (timestampbuf, "%lu", *results->startup_timestamp);
+
+          /* we allocated argv_copy with extra space so we could do this */
+          insert_args (&argc_copy, argv_copy,
+                       "--startup-timestamp", timestampbuf);
+        }
+
       /* Forward our display to the child */
       insert_args (&argc_copy, argv_copy,
                    "--display", results->display_name);
@@ -1779,6 +1833,29 @@ find_screen_by_display_name (const char 
   return screen;
 }
 
+/* FIXME: When we switch to gtk+-2.6, use of this function should be
+ * replaced by using the real gdk_x11_window_set_user_time.
+ */
+static void
+copy_of_gdk_x11_window_set_user_time (GdkWindow *window,
+                                      Time       timestamp)
+{
+  GdkDisplay *display;
+
+  g_return_if_fail (window != NULL);
+  g_return_if_fail (GDK_IS_WINDOW (window));
+
+  if (GDK_WINDOW_DESTROYED (window))
+    return;
+
+  display = gdk_drawable_get_display (window);
+
+  XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
+                   gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
+                   XA_CARDINAL, 32, PropModeReplace,
+                   (guchar *)&timestamp, 1);
+}
+
 void
 terminal_app_new_terminal (TerminalApp     *app,
                            TerminalProfile *profile,
@@ -1792,6 +1869,7 @@ terminal_app_new_terminal (TerminalApp  
                            const char      *role,
                            double           zoom,
                            const char      *startup_id,
+                           Time            *startup_timestamp,
                            const char      *display_name,
                            int              screen_number)
 {
@@ -1870,7 +1948,16 @@ terminal_app_new_terminal (TerminalApp  
    * http://bugzilla.gnome.org/show_bug.cgi?id=78253
    */
   if (window_created)
-    gtk_window_present (GTK_WINDOW (window));
+    {
+      if (startup_timestamp != NULL)
+        {
+          gtk_widget_realize (GTK_WIDGET (window));
+          copy_of_gdk_x11_window_set_user_time (GTK_WIDGET (window)->window,
+                                                *startup_timestamp);
+        }
+
+      gtk_window_present (GTK_WINDOW (window));
+    }
 
   terminal_screen_launch_child (screen);
 }
Index: src/terminal.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal.h,v
retrieving revision 1.17
diff -p -u -r1.17 terminal.h
--- src/terminal.h	5 Nov 2003 00:50:14 -0000	1.17
+++ src/terminal.h	27 Aug 2004 22:23:37 -0000
@@ -27,6 +27,8 @@
 #include <glade/glade.h>
 #include "terminal-screen.h"
 
+#include <gdk/gdkx.h>
+
 typedef struct _TerminalApp TerminalApp;
 
 TerminalApp* terminal_app_get (void);
@@ -51,6 +53,7 @@ void terminal_app_new_terminal (Terminal
                                 const char      *role,
                                 double           zoom,
                                 const char      *startup_id,
+                                Time            *startup_timestamp,
                                 const char      *display_name,
                                 int              screen_number);
 
