From aae6633c28ddcdad834f5ad0fe4f890e96c2afa0 Mon Sep 17 00:00:00 2001 From: TingPing Date: Wed, 8 Jan 2014 09:03:50 -0500 Subject: Don't select tab while closing with middle-click Also fix unused warning and ignore shift right click --- src/fe-gtk/chanview-tree.c | 2 -- src/fe-gtk/maingui.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c index 09ca2dbb..07806860 100644 --- a/src/fe-gtk/chanview-tree.c +++ b/src/fe-gtk/chanview-tree.c @@ -57,12 +57,10 @@ static gboolean cv_tree_click_cb (GtkTreeView *tree, GdkEventButton *event, chanview *cv) { chan *ch; - GtkTreeSelection *sel; GtkTreePath *path; GtkTreeIter iter; int ret = FALSE; - sel = gtk_tree_view_get_selection (tree); if (gtk_tree_view_get_path_at_pos (tree, event->x, event->y, &path, 0, 0, 0)) { if (gtk_tree_model_get_iter (GTK_TREE_MODEL (cv->store), &iter, path)) diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 4bd5d370..0186e944 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -1606,10 +1606,11 @@ static gboolean mg_tab_contextmenu_cb (chanview *cv, chan *ch, int tag, gpointer ud, GdkEventButton *event) { /* middle-click or shift-click to close a tab */ - if ((event->button == 2 || event->state & STATE_SHIFT) && event->type == GDK_BUTTON_PRESS) + if ((event->button == 2 || (event->button == 1 && event->state & STATE_SHIFT)) + && event->type == GDK_BUTTON_PRESS) { mg_xbutton_cb (cv, ch, tag, ud); - return FALSE; + return TRUE; } if (event->button != 3) -- cgit 1.4.1