Commit 69144d78 authored by Corey Daley's avatar Corey Daley Committed by Sébastien Lafargue

notebook: Allow closing of tabs with middle mouse button

parent 958f70dd
......@@ -146,7 +146,6 @@ gedit_notebook_button_press_event (GtkWidget *widget,
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
if (event->type == GDK_BUTTON_PRESS &&
event->button == GDK_BUTTON_SECONDARY &&
(event->state & gtk_accelerator_get_default_mod_mask ()) == 0)
{
gint tab_clicked;
......@@ -157,10 +156,19 @@ gedit_notebook_button_press_event (GtkWidget *widget,
GtkWidget *tab;
tab = gtk_notebook_get_nth_page (notebook, tab_clicked);
switch (event->button)
{
case GDK_BUTTON_SECONDARY:
g_signal_emit (G_OBJECT (widget), signals[SHOW_POPUP_MENU], 0, event, tab);
return GDK_EVENT_STOP;
g_signal_emit (G_OBJECT (widget), signals[SHOW_POPUP_MENU], 0, event, tab);
case GDK_BUTTON_MIDDLE:
g_signal_emit (G_OBJECT (notebook), signals[TAB_CLOSE_REQUEST], 0, tab);
return GDK_EVENT_STOP;
return GDK_EVENT_STOP;
default:
break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment