From d2fb36e60a6d94d1434853fe629f99301447111e Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sat, 6 Mar 2004 23:30:19 +0000 Subject: [PATCH] define GIMP_APP_VERSION 2004-03-07 Sven Neumann * tools/Makefile.am (AM_CPPFLAGS): define GIMP_APP_VERSION * tools/gimp-remote.c: when starting a new gimp, make sure the desktop-startup-id gets passed to it. Makes startup notification work correctly again. --- ChangeLog | 8 ++++++++ tools/Makefile.am | 2 ++ tools/gimp-remote.c | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0f71d0a65..8dae0e2cc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-03-07 Sven Neumann + + * tools/Makefile.am (AM_CPPFLAGS): define GIMP_APP_VERSION + + * tools/gimp-remote.c: when starting a new gimp, make sure the + desktop-startup-id gets passed to it. Makes startup notification + work correctly again. + 2004-03-06 Sven Neumann * plug-ins/common/tiff.c (run): corrected check for number of PDB diff --git a/tools/Makefile.am b/tools/Makefile.am index d86ccff642..2399d6ff78 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -28,6 +28,8 @@ gimp_remote_1_3_LDADD = \ kernelgen_SOURCES = kernelgen.c +AM_CPPFLAGS = -DGIMP_APP_VERSION=\"@GIMP_APP_VERSION@\" + INCLUDES = \ -I$(top_srcdir) \ $(GTK_CFLAGS) \ diff --git a/tools/gimp-remote.c b/tools/gimp-remote.c index c24d66999e..144f64ccfe 100644 --- a/tools/gimp-remote.c +++ b/tools/gimp-remote.c @@ -53,7 +53,8 @@ #include "libgimpbase/gimpversion.h" -#define GIMP_BINARY "gimp-1.3" +#define GIMP_BINARY "gimp-" GIMP_APP_VERSION + static gboolean existing = FALSE; static gboolean query = FALSE; @@ -177,6 +178,7 @@ usage (const gchar *name) static void start_new_gimp (GdkScreen *screen, const gchar *argv0, + const gchar *startup_id, GString *file_list) { gchar *display_name; @@ -185,6 +187,9 @@ start_new_gimp (GdkScreen *screen, const gchar *spath; gint i; + if (startup_id) + setenv ("DESKTOP_STARTUP_ID", startup_id, TRUE); + if (file_list->len > 0) file_list = g_string_prepend (file_list, "\n"); @@ -302,12 +307,23 @@ gint main (gint argc, gchar **argv) { - GdkDisplay *display; - GdkScreen *screen; - GdkWindow *gimp_window; - GString *file_list = g_string_new (NULL); - gchar *cwd = g_get_current_dir (); - gint i; + GdkDisplay *display; + GdkScreen *screen; + GdkWindow *gimp_window; + const gchar *startup_id; + gchar *desktop_startup_id = NULL; + GString *file_list = g_string_new (NULL); + gchar *cwd = g_get_current_dir (); + gint i; + + /* we save the startup_id before calling gtk_init() + because GTK+ will unset it */ + + startup_id = g_getenv ("DESKTOP_STARTUP_ID"); + if (startup_id && *startup_id) + desktop_startup_id = g_strdup (startup_id); + + g_print ("%s\n", desktop_startup_id); gtk_init (&argc, &argv); @@ -371,7 +387,7 @@ main (gint argc, /* if called without any filenames, always start a new GIMP */ if (file_list->len == 0 && !query && !existing) { - start_new_gimp (screen, argv[0], file_list); + start_new_gimp (screen, argv[0], desktop_startup_id, file_list); } gimp_window = gimp_remote_find_window (display, screen); @@ -447,10 +463,13 @@ main (gint argc, if (existing) exit (EXIT_FAILURE); - start_new_gimp (screen, argv[0], file_list); + start_new_gimp (screen, argv[0], desktop_startup_id, file_list); } g_string_free (file_list, TRUE); + g_free (desktop_startup_id); + + gdk_notify_startup_complete (); return EXIT_SUCCESS; }