diff -u -u -r1.15 rb-marshal.list
--- lib/rb-marshal.list	9 Apr 2006 11:02:15 -0000	1.15
+++ lib/rb-marshal.list	12 Apr 2006 12:43:33 -0000
@@ -1,5 +1,7 @@
+BOOLEAN:BOOLEAN,BOOLEAN
 BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN
 BOOLEAN:POINTER
+BOOLEAN:VOID
 INT:VOID
 STRING:STRING
 VOID:BOOLEAN,BOOLEAN
diff -u -u -r1.426 rb-shell.c
--- shell/rb-shell.c	11 Apr 2006 10:27:46 -0000	1.426
+++ shell/rb-shell.c	12 Apr 2006 12:43:54 -0000
@@ -89,6 +89,7 @@
 #include "rb-plugins-engine.h"
 #include "rb-plugin-manager.h"
 #include "rb-proxy-config.h"
+#include "rb-marshal.h"
 
 static void rb_shell_class_init (RBShellClass *klass);
 static void rb_shell_remote_proxy_init (RBRemoteProxyIface *iface);
@@ -215,6 +216,10 @@
 static void rb_shell_set_visibility (RBShell *shell,
 				     gboolean visible,
 				     gboolean force);
+static gboolean rb_shell_set_visibility_default (RBShell *shell,
+						 gboolean visible,
+						 gboolean force);
+static gboolean rb_shell_window_close_default (RBShell *shell);
 static void sourcelist_visibility_changed_cb (GConfClient *client,
 					      guint cnxn_id,
 					      GConfEntry *entry,
@@ -338,6 +343,14 @@
                         G_IMPLEMENT_INTERFACE (RB_TYPE_REMOTE_PROXY, 
                                                rb_shell_remote_proxy_init));
 
+enum
+{
+	SET_VISIBILITY,
+	WINDOW_CLOSE,
+	LAST_SIGNAL
+};
+static guint rb_shell_signals[LAST_SIGNAL] = { 0 };
+
 
 struct RBShellPrivate
 {
@@ -516,6 +529,9 @@
         object_class->finalize = rb_shell_finalize;
 	object_class->constructor = rb_shell_constructor;
 
+	klass->set_visibility = rb_shell_set_visibility_default;
+	klass->window_close = rb_shell_window_close_default;
+
 	g_object_class_install_property (object_class,
 					 PROP_ARGC,
 					 g_param_spec_int ("argc", 
@@ -656,6 +672,27 @@
 							      RB_TYPE_LIBRARY_SOURCE,
 							      G_PARAM_READABLE));
 
+	
+	rb_shell_signals[SET_VISIBILITY] =
+		g_signal_new ("set-visibility",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (RBShellClass, set_visibility),
+			      g_signal_accumulator_true_handled, NULL,
+			      rb_marshal_BOOLEAN__BOOLEAN_BOOLEAN,
+			      G_TYPE_BOOLEAN,
+			      2,
+			      G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+	rb_shell_signals[WINDOW_CLOSE] =
+		g_signal_new ("window-close",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (RBShellClass, window_close),
+			      g_signal_accumulator_true_handled, NULL,
+			      rb_marshal_BOOLEAN__VOID,
+			      G_TYPE_BOOLEAN,
+			      0);
+
 
 	g_type_class_add_private (klass, sizeof (RBShellPrivate));
 }
@@ -1497,12 +1534,24 @@
 			 gboolean visible,
 			 gboolean force)
 {
+	gboolean handled = FALSE;
+
+	g_signal_emit (shell, rb_shell_signals[SET_VISIBILITY], 0,
+		       visible, force, &handled);
+
+}
+
+static gboolean
+rb_shell_set_visibility_default (RBShell *shell,
+				 gboolean visible,
+				 gboolean force)
+{
 	gboolean current_visible;
 
 
 	current_visible = rb_shell_get_visibility (shell);
 	if (!force && visible == current_visible)
-		return;
+		return TRUE;
 
 	/* FIXME - see below */
 	if (shell->priv->idle_hide_mainwindow_id > 0)
@@ -1550,6 +1599,10 @@
 		eel_gconf_set_boolean (CONF_STATE_WINDOW_VISIBLE, FALSE);
 	}
 
+	/* returning FALSE allows connecting after the default handler as a
+	 * method of watching for visibility changes
+	 */
+	return FALSE;
 }
 
 static gboolean
@@ -1586,12 +1639,20 @@
 			   GdkEventAny *event,
 			   RBShell *shell)
 {
+	gboolean handled = FALSE;
+
 	if (shell->priv->party_mode) {
 		return TRUE;
 	}
 
-	rb_shell_quit (shell);
+	g_signal_emit (shell, rb_shell_signals[WINDOW_CLOSE], 0, &handled);
+	return handled;
+}
 
+static gboolean
+rb_shell_window_close_default (RBShell *shell)
+{
+	rb_shell_quit (shell);
 	return TRUE;
 }
 
diff -u -u -r1.27 rb-shell.h
--- shell/rb-shell.h	12 Apr 2006 11:13:29 -0000	1.27
+++ shell/rb-shell.h	12 Apr 2006 12:43:54 -0000
@@ -59,6 +59,12 @@
 typedef struct
 {
         GObjectClass parent_class;
+
+	/* signals */
+	gboolean	(*set_visibility)	(RBShell *shell,
+						 gboolean visible,
+						 gboolean force);
+	gboolean	(*window_close)		(RBShell *shell);
 } RBShellClass;
 
 GType		rb_shell_get_type	(void);
