Here's a patch to add optional libstartup-notification support to The
Gimp. This will allow desktop managers as Gnome's to entertain users
with a *so* funny clock cursor, while Gimp launches and initializes
itself.

I hope the maintainers find this worthy of being included in the main
distribution.

Regards,

-- 
Miguel Ibarra <[EMAIL PROTECTED]>
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' gimp-1.2.5.orig/app/Makefile.am gimp-1.2.5/app/Makefile.am
--- gimp-1.2.5.orig/app/Makefile.am	Thu Feb 13 17:13:11 2003
+++ gimp-1.2.5/app/Makefile.am	Thu Jul 24 15:42:13 2003
@@ -464,6 +464,7 @@
 	-I$(top_srcdir)			\
 	-I$(top_srcdir)/intl		\
 	$(GTK_CFLAGS)			\
+	$(STARTUP_NOTIFICATION_CFLAGS)  \
 	-I$(includedir)
 
 gimp_1_2_LDADD = \
@@ -474,6 +475,7 @@
 	$(GTK_LIBS)				\
 	$(GIMP_THREAD_LIBS)			\
 	$(GIMP_MP_LIBS)				\
+	$(STARTUP_NOTIFICATION_LIBS)            \
 	$(INTLLIBS)
 
 gimp-win32res.o : gimp.rc
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' gimp-1.2.5.orig/app/app_procs.c gimp-1.2.5/app/app_procs.c
--- gimp-1.2.5.orig/app/app_procs.c	Thu Apr  3 17:59:30 2003
+++ gimp-1.2.5/app/app_procs.c	Thu Jul 24 15:42:31 2003
@@ -349,11 +349,59 @@
 static GtkWidget *label2 = NULL;
 static GtkWidget *pbar   = NULL;
 
+#ifdef HAVE_STARTUP_NOTIFICATION
+#define SN_API_NOT_YET_FROZEN
+#include <libsn/sn-launchee.h>
+#include <gdk/gdkx.h>
+
+static void
+sn_error_trap_push (SnDisplay *display,
+                    Display   *xdisplay)
+{
+  gdk_error_trap_push ();
+}
+                                                                                
+static void
+sn_error_trap_pop (SnDisplay *display,
+                   Display   *xdisplay)
+{
+  gdk_error_trap_pop ();
+}
+
+static void
+startup_notification_complete(void)
+{
+  SnDisplay *sn_display = NULL;
+  SnLauncheeContext *context = NULL;
+  Display *xdisplay;
+
+  xdisplay = GDK_WINDOW_XDISPLAY(win_initstatus->window);
+  sn_display = sn_display_new (xdisplay,
+			       sn_error_trap_push,
+			       sn_error_trap_pop);
+  
+  context = sn_launchee_context_new_from_environment (sn_display,
+						      DefaultScreen(xdisplay));
+
+  if (context != NULL)
+    {
+      sn_launchee_context_complete (context);
+      sn_launchee_context_unref (context);
+      sn_display_unref (sn_display);
+    }
+
+}
+#endif
+
 static void
 destroy_initialization_status_window (void)
 {
   if (win_initstatus)
     {
+      #ifdef HAVE_STARTUP_NOTIFICATION
+      startup_notification_complete();
+      #endif
+
       gtk_widget_destroy (win_initstatus);
 
       if (logo_pixmap != NULL)
@@ -362,6 +410,7 @@
       logo_pixmap = NULL;
       win_initstatus = label1 = label2 = pbar = logo_area = NULL;
     }
+
 }
 
 static void
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' gimp-1.2.5.orig/configure.in gimp-1.2.5/configure.in
--- gimp-1.2.5.orig/configure.in	Sun Jun  1 22:54:58 2003
+++ gimp-1.2.5/configure.in	Thu Jul 24 15:41:48 2003
@@ -748,6 +748,8 @@
 *** --disable-print to configure (but you won't be able to print then).])
 fi
 
+dnl This is for startup notification
+PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5, AC_DEFINE([HAVE_STARTUP_NOTIFICATION],[], [Should we use libstartup-notification]) echo "Building with libstartup-notification", echo "Building without libstartup-notification")
 
 dnl This is for the gimp-perl plug-in
 AC_ARG_ENABLE(perl, [  --disable-perl          do not build perl extension [by default enabled]
@@ -931,6 +933,9 @@
 AC_SUBST(GIMP_PLUGINS)
 AC_SUBST(GIMP_MODULES)
 
+AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
+AC_SUBST(STARTUP_NOTIFICATION_LIBS)
+
 dnl Output the Makefiles
 
 AC_OUTPUT([
_______________________________________________
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer

Reply via email to