=== modified file 'gedit/gedit-window.c'
--- gedit/gedit-window.c	2010-08-25 21:46:36 +0000
+++ gedit/gedit-window.c	2010-08-25 21:50:48 +0000
@@ -3533,11 +3533,27 @@
 			     GdkEventButton *event,
 			     GeditWindow    *window)
 {
-	if (GDK_BUTTON_PRESS == event->type && 3 == event->button)
+	if (GDK_BUTTON_PRESS == event->type)
 	{
-		return show_notebook_popup_menu (notebook, window, event);
+        if (3 == event->button)
+        {
+            /* Right click */
+		    return show_notebook_popup_menu (notebook, window, event);
+        }
+        else if (2 == event->button)
+        {
+            /* Middle click */
+            printf("Middle click\n");
+            
+            GtkWidget *tab;
+	    	tab = GTK_WIDGET (gedit_window_get_active_tab (window));
+    		g_return_val_if_fail (tab != NULL, FALSE);
+            
+            notebook_tab_close_request(notebook, tab, window);
+            return TRUE;
+        }
 	}
-
+    
 	return FALSE;
 }
 

