summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2016-12-19 23:45:03 +0100
committermonsta <[email protected]>2017-01-30 15:55:10 +0400
commitbfccb7704338f157477f2faa94d70247ea23dd48 (patch)
treebbbbcaedf1efd86b217aacb3ff057de8076b7626 /src
parent127304f61753830411a661ea18f6bee643fcd823 (diff)
downloadmate-terminal-bfccb7704338f157477f2faa94d70247ea23dd48.tar.bz2
mate-terminal-bfccb7704338f157477f2faa94d70247ea23dd48.tar.xz
middle click on a tab: make the tab active before closing it
Fixes: If we are on a tab, and we make middle click on another tab, it doesn't show the confirm close dialog if there is a foreground process
Diffstat (limited to 'src')
-rw-r--r--src/terminal-window.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index fb536f7..bbe82f8 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2899,21 +2899,26 @@ notebook_button_press_cb (GtkWidget *widget,
TerminalWindow *window)
{
TerminalWindowPrivate *priv = window->priv;
- TerminalScreen *active_screen = priv->active_screen;
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GtkWidget *tab;
GtkWidget *menu;
GtkAction *action;
int tab_clicked;
- if ((event->type == GDK_BUTTON_PRESS && event->button == 2)
- && !(confirm_close_window_or_tab (window, active_screen)))
+ 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);
+ gtk_notebook_set_current_page (notebook, tab_clicked);
+ TerminalScreen *active_screen = priv->active_screen;
+
+ if (!(confirm_close_window_or_tab (window, active_screen)))
+ {
+ update_tab_visibility (window, -1);
+ gtk_notebook_remove_page(notebook, tab_clicked);
+ }
+
}
}