summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-05-02 10:19:12 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-05-02 13:21:34 +0200
commitd6187a3dc4b7827228663689445d9f8bcb7a6868 (patch)
tree46e25579cf489991b463aee08e0ebc7808ee77ec
parent96e1d7bfac74b3668115dc860f42c38289956f12 (diff)
downloadgtk+-d6187a3dc4b7827228663689445d9f8bcb7a6868.tar.gz
gtknotebook: avoid tab dnd from content
Before commit 6c1bee2377eba8 we were setting an attribute of GtkNotebook to track the pressed button if the pressed button happened on the tab itself. Later in the motion handling code we were checking whether the private pressed button attribute was set or not in order to handle a tab dnd or not. In commit 6c1bee2377eba8 the code changed and set the pressed button variable unconditionally, which means, a motion event from within the tab content triggered a tab reordering. This happened only if the children hierarchy have a widget that bubbles up both button press event, which sets the private pressed button attribute; and motion events, which started the tab dnd checking the private pressed button attribute. A widget that experienced the regression was GtkListBox. In order to fix it, set the button pressed variable only when it press the tab itself, not the content. https://bugzilla.gnome.org/show_bug.cgi?id=764395
-rw-r--r--gtk/gtknotebook.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 3deb5c1453..d00d7e3be4 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2747,8 +2747,6 @@ gtk_notebook_button_press (GtkWidget *widget,
if (event->button != GDK_BUTTON_PRIMARY)
return FALSE;
- priv->pressed_button = event->button;
-
if ((tab = get_tab_at_pos (notebook, x, y)) != NULL)
{
GtkAllocation allocation;
@@ -2767,6 +2765,8 @@ gtk_notebook_button_press (GtkWidget *widget,
/* save press to possibly begin a drag */
if (page->reorderable || page->detachable)
{
+ priv->pressed_button = event->button;
+
priv->mouse_x = x;
priv->mouse_y = y;