diff -u -u -r1.218 configure.ac
--- configure.ac	19 Mar 2006 22:39:39 -0000	1.218
+++ configure.ac	20 Mar 2006 02:02:50 -0000
@@ -851,6 +851,7 @@
 plugins/audioscrobbler/Makefile
 plugins/sample-python/Makefile
 plugins/pythonconsole/Makefile
+plugins/closehide/Makefile
 bindings/Makefile
 bindings/python/Makefile
 help/Makefile
diff -u -u -r1.66 rhythmbox.schemas
--- data/rhythmbox.schemas	1 Mar 2006 03:12:43 -0000	1.66
+++ data/rhythmbox.schemas	20 Mar 2006 02:02:51 -0000
@@ -605,5 +605,16 @@
 	<long>When enabled, Rhythmbox will display notification bubbles when the playing track changes, a podcast is downloaded, a CD finished burning, etc.</long>
         </locale>
       </schema>
+
+      <schema>
+        <key>/schema/apps/rhythmbox/plugins/closehide/active</key>
+        <applyto>/apps/rhythmbox/plugins/closehide/active</applyto>
+        <owner>rhythmbox</owner>
+        <type>bool</type>
+        <default>0</default>
+        <locale name="C">
+	<short>Whether Rhythmbox should minimise to the tray when the close button is pressed</short>
+	<long>Whether Rhythmbox should minimise to the tray when the close button is pressed</long>
+        </locale>
     </schemalist>
 </gconfschemafile>
diff -u -u -r1.2 Makefile.am
--- plugins/Makefile.am	19 Mar 2006 22:39:40 -0000	1.2
+++ plugins/Makefile.am	20 Mar 2006 02:02:52 -0000
@@ -7,7 +7,7 @@
 endif
 
 if ENABLE_PYTHON
-SUBDIRS += pythonconsole sample-python
+SUBDIRS += pythonconsole sample-python closehide
 endif
 
 noinst_LTLIBRARIES = librbplugins.la
--- /dev/null	2006-03-16 19:06:34.000000000 +1100
+++ plugins/closehide/closehide.rb-plugin.desktop.in	2006-03-20 11:39:34.000000000 +1100
@@ -0,0 +1,9 @@
+[RB Plugin]
+Loader=python
+Module=closehide
+IAge=1
+_Name=Hide on Close
+_Description=Makes the close button minimise to the tray instead of quitting
+Authors=James Livingston <doclivingston@gmail.com>
+Copyright=Copyright © 2006 James Livingston
+Website=http://www.rhythmbox.org/
--- /dev/null	2006-03-16 19:06:34.000000000 +1100
+++ plugins/closehide/closehide.py	2006-03-20 12:50:57.000000000 +1100
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+
+# closehide.py
+#
+# Copyright (C) 2006 - James Livingston
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import gobject
+import gtk
+import rb
+
+class CloseHidePlugin(rb.Plugin):
+	def __init__(self):
+		rb.Plugin.__init__(self)
+			
+	def activate(self, shell):
+		window = shell.get_property('window')
+		self.delete_id = window.connect('delete_event', self.hide_window, shell)
+				
+	def deactivate(self, shell):
+		window = shell.get_property('window')
+		window.disconnect(self.delete_id)
+
+	def hide_window(self, window, event, shell):
+		shell.set_visibility(False)
+		
+		# continue quitting if we couldn't become hidden
+		return not shell.get_visibility ()
+		
--- /dev/null	2006-03-16 19:06:34.000000000 +1100
+++ plugins/closehide/Makefile.am	2006-03-20 11:37:26.000000000 +1100
@@ -0,0 +1,13 @@
+# "hide on close button" Plugin
+plugindir = $(PLUGINDIR)
+plugin_PYTHON = closehide.py
+
+plugin_in_files = closehide.rb-plugin.desktop.in
+%.rb-plugin: %.rb-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+
+plugin_DATA = $(plugin_in_files:.rb-plugin.desktop.in=.rb-plugin)
+
+EXTRA_DIST = $(plugin_in_files)
+
+CLEANFILES = $(plugin_DATA)
+DISTCLEANFILES = $(plugin_DATA)
