Index: src/ephy-notebook.c
===================================================================
--- src/ephy-notebook.c	(revision 8913)
+++ src/ephy-notebook.c	(working copy)
@@ -305,13 +305,11 @@
 		 GdkEventButton *event,
 		 gpointer data)
 {
-	int tab_clicked;
+	gint tab_clicked;
 
 	tab_clicked = find_tab_num_at_pos (notebook, event->x_root, event->y_root);
 
-	if (event->type == GDK_BUTTON_PRESS &&
-	    event->button == 3 &&
-		   (event->state & gtk_accelerator_get_default_mod_mask ()) == 0)
+	if (event->type == GDK_BUTTON_PRESS && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0)
 	{
 		if (tab_clicked == -1)
 		{
@@ -320,9 +318,16 @@
 			 */
 			return TRUE;
 		}
-
-		/* switch to the page the mouse is over, but don't consume the event */
-		gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), tab_clicked);
+		
+	    if (event->button == 3)
+		{
+			/* switch to the page the mouse is over, but don't consume the event */
+			gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), tab_clicked);
+		}
+		else if (event->button == 2)	/* close on middle click */
+		{
+			gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), tab_clicked);
+		}
 	}
 
 	return FALSE;
