summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2018-02-13 11:46:16 +0100
committerErnestas Kulik <ernestask@gnome.org>2018-03-24 20:23:30 +0200
commit957f2825f5921e2b7591aa7ec6e50ecd41cf119d (patch)
tree39dfaefe422ce0bfdba89ff20af09df5d1e9a5ce
parent57664cd25ef39b18bc312cd6fcf2544231d4db9f (diff)
downloadnautilus-957f2825f5921e2b7591aa7ec6e50ecd41cf119d.tar.gz
notebook: Add middle click tab close support
It was requested for some time given that browsers do it. It's also quite harmless. Closes https://gitlab.gnome.org/GNOME/nautilus/issues/47
-rw-r--r--src/nautilus-notebook.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index 3f6b94667..f2b3fbdf1 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -160,6 +160,14 @@ button_press_cb (NautilusNotebook *notebook,
/* 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->type == GDK_BUTTON_PRESS &&
+ event->button == GDK_BUTTON_MIDDLE)
+ {
+ GtkWidget *slot;
+
+ slot = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), tab_clicked);
+ g_signal_emit (notebook, signals[TAB_CLOSE_REQUEST], 0, slot);
+ }
return FALSE;
}