diff options
Diffstat (limited to 'pluma/pluma-notebook.c')
-rw-r--r-- | pluma/pluma-notebook.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/pluma/pluma-notebook.c b/pluma/pluma-notebook.c index d2b35d25..591b6220 100644 --- a/pluma/pluma-notebook.c +++ b/pluma/pluma-notebook.c @@ -591,6 +591,9 @@ button_press_cb (PlumaNotebook *notebook, GdkEventButton *event, gpointer data) { + static gboolean newfile = FALSE; + static gint tab1click = -1; + gint tab_clicked; if (notebook->priv->drag_in_progress) @@ -599,7 +602,7 @@ button_press_cb (PlumaNotebook *notebook, tab_clicked = find_tab_num_at_pos (notebook, event->x_root, event->y_root); - + if ((event->button == 1) && (event->type == GDK_BUTTON_PRESS) && (tab_clicked >= 0)) @@ -633,6 +636,23 @@ button_press_cb (PlumaNotebook *notebook, } } + if (event->button == 1) + { + if (event->type == GDK_BUTTON_PRESS) + { + tab1click = gtk_notebook_get_current_page (notebook); + newfile = (tab_clicked == -1); + } + else if (event->type == GDK_2BUTTON_PRESS) + { + if ((tab1click != gtk_notebook_get_current_page (notebook)) || + (tab_clicked >= 0) || ((tab_clicked == -1) && (!newfile))) + return TRUE; + + newfile = FALSE; + } + } + return FALSE; } |