[epiphany] notebook: Support middle-click close



commit 6ad3a5fe8dcd96df91bd394d3e0b15340ef4e3d7
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Feb 23 20:26:02 2018 -0600

    notebook: Support middle-click close
    
    The crowds will love this.

 src/ephy-notebook.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index bddbaef..9284e66 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -219,6 +219,12 @@ button_press_cb (EphyNotebook   *notebook,
 
   tab_clicked = find_tab_num_at_pos (notebook, event->x_root, event->y_root);
 
+  if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_MIDDLE) {
+    GtkWidget *tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), tab_clicked);
+    g_signal_emit (notebook, signals[TAB_CLOSE_REQUEST], 0, tab);
+    return GDK_EVENT_STOP;
+  }
+
   if (event->type == GDK_BUTTON_PRESS &&
       event->button == 3 &&
       (event->state & gtk_accelerator_get_default_mod_mask ()) == 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]