summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2016-11-11 09:46:08 +0100
committerZenWalker <[email protected]>2016-11-11 09:46:08 +0100
commit4d5943140d423c9148a9f9118ae638fba905bfb8 (patch)
tree26b484ceeb13321f77a7df5ee4187a77b40961b5 /src
parentdf326ad5d26ad3ec74f15c692dc90be1f42fbb67 (diff)
downloadmate-terminal-4d5943140d423c9148a9f9118ae638fba905bfb8.tar.bz2
mate-terminal-4d5943140d423c9148a9f9118ae638fba905bfb8.tar.xz
Implement middle click tab closing
Fixes #155 Author: bl0ckeduser
Diffstat (limited to 'src')
-rw-r--r--src/terminal-window.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 2846d0d..b015820 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2901,6 +2901,16 @@ notebook_button_press_cb (GtkWidget *widget,
GtkAction *action;
int tab_clicked;
+ if (event->type == GDK_BUTTON_PRESS && event->button == 2)
+ {
+ tab_clicked = find_tab_num_at_pos (notebook, event->x_root, event->y_root);
+ if (tab_clicked >= 0)
+ {
+ update_tab_visibility (window, -1);
+ gtk_notebook_remove_page(notebook, tab_clicked);
+ }
+ }
+
if (event->type != GDK_BUTTON_PRESS ||
event->button != 3 ||
(event->state & gtk_accelerator_get_default_mod_mask ()) != 0)