summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-05-15 15:55:50 +0200
committerraveit65 <[email protected]>2017-11-04 19:14:46 +0100
commit21c58b0a959797e5ee229434ecf7605f67c89216 (patch)
treeee72d4982b7fa0e832840c11726dbd5fda13b8e8
parente356b45aff763166b469d31882c34d7f1c277c01 (diff)
downloadpluma-21c58b0a959797e5ee229434ecf7605f67c89216.tar.bz2
pluma-21c58b0a959797e5ee229434ecf7605f67c89216.tar.xz
Fix: pluma closes tabs unexpectedly with middle click
Fixes #228
-rw-r--r--pluma/pluma-notebook.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pluma/pluma-notebook.c b/pluma/pluma-notebook.c
index d2b35d25..10d15f48 100644
--- a/pluma/pluma-notebook.c
+++ b/pluma/pluma-notebook.c
@@ -81,6 +81,7 @@ static void move_current_tab_to_another_notebook (PlumaNotebook *src,
/* Local variables */
static GdkCursor *cursor = NULL;
+static gboolean leftdown = FALSE;
/* Signals */
enum
@@ -389,6 +390,8 @@ static void
drag_start (PlumaNotebook *notebook,
guint32 time)
{
+ if (!leftdown) return;
+
notebook->priv->drag_in_progress = TRUE;
/* get a new cursor, if necessary */
@@ -552,6 +555,8 @@ button_release_cb (PlumaNotebook *notebook,
GdkEventButton *event,
gpointer data)
{
+ if (event->button == 1) leftdown = FALSE;
+
if (notebook->priv->drag_in_progress)
{
gint cur_page_num;
@@ -604,6 +609,8 @@ button_press_cb (PlumaNotebook *notebook,
(event->type == GDK_BUTTON_PRESS) &&
(tab_clicked >= 0))
{
+ leftdown = TRUE;
+
notebook->priv->x_start = event->x_root;
notebook->priv->y_start = event->y_root;
@@ -627,6 +634,11 @@ button_press_cb (PlumaNotebook *notebook,
}
else
{
+ if (leftdown) {
+ leftdown = FALSE;
+ return TRUE;
+ }
+
/* Switch to the page the mouse is over, but don't consume the event */
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook),
tab_clicked);