summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@src.gnome.org>2016-10-18 18:52:20 +0300
committerErnestas Kulik <ernestask@src.gnome.org>2017-02-01 15:04:46 +0200
commit7f986a0d30aa27e2a7283481f0cf6cc09d4ff634 (patch)
tree3cdf57d033083f0a07b1e4b055592db8e9b563b0
parent2591f9dcd1f6fa85a03ad904c554288a709a46f0 (diff)
downloadnautilus-7f986a0d30aa27e2a7283481f0cf6cc09d4ff634.tar.gz
floating-bar: fix hide on hover with notebook visible
When the notebook is visible, the pointer intersection with the floating bar check fails. That is due to how the floating bar bounds are calculated - the offset of the overlay when tabs are visible is not taken into account, allowing the upper y bound to become smaller than the lower bound. That can be fixed by calculating the upper y bound relative to the lower one. https://bugzilla.gnome.org/show_bug.cgi?id=773119
-rw-r--r--src/nautilus-floating-bar.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nautilus-floating-bar.c b/src/nautilus-floating-bar.c
index dc866c013..2a6a2c5cc 100644
--- a/src/nautilus-floating-bar.c
+++ b/src/nautilus-floating-bar.c
@@ -231,7 +231,6 @@ overlay_enter_notify_cb (GtkWidget *parent,
{
GtkWidget *widget = user_data;
CheckPointerData *data;
- GtkAllocation alloc_parent;
gint y_pos;
NautilusFloatingBar *self = NAUTILUS_FLOATING_BAR (widget);
@@ -251,7 +250,6 @@ overlay_enter_notify_cb (GtkWidget *parent,
return GDK_EVENT_PROPAGATE;
}
- gtk_widget_get_allocation (parent, &alloc_parent);
gdk_window_get_position (gtk_widget_get_window (widget), NULL, &y_pos);
data = g_slice_new (CheckPointerData);
@@ -259,7 +257,7 @@ overlay_enter_notify_cb (GtkWidget *parent,
data->floating_bar = widget;
data->device = gdk_event_get_device ((GdkEvent *) event);
data->y_down_limit = y_pos;
- data->y_upper_limit = alloc_parent.height;
+ data->y_upper_limit = y_pos + gtk_widget_get_allocated_height (widget);
self->priv->hover_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, HOVER_HIDE_TIMEOUT_INTERVAL,
check_pointer_timeout, data,