[gtk+/wip/baedert/drawing: 183/183] range: Fix click detection in slider trace
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 183/183] range: Fix click detection in slider trace
- Date: Sat, 20 May 2017 13:31:52 +0000 (UTC)
commit f9fac516f11f8adec3c9b24c00e0af70f0aa7780
Author: Timm Bäder <mail baedert org>
Date: Sat May 20 15:04:03 2017 +0200
range: Fix click detection in slider trace
The x/y/ coordinates are relative to the range allocation, so take that
into account.
gtk/gtkrange.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 4af4ffd..a46374b 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2058,6 +2058,7 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
"gtk-primary-button-warps-slider", &primary_warps,
NULL);
+
if (priv->mouse_location == priv->slider_widget &&
gdk_event_triggers_context_menu (event))
{
@@ -2796,7 +2797,7 @@ gtk_range_update_mouse_location (GtkRange *range)
priv->mouse_location = priv->grab_location;
else if (rectangle_contains_point (&slider_alloc, range_alloc.x + x, range_alloc.y + y))
priv->mouse_location = priv->slider_widget;
- else if (rectangle_contains_point (&slider_trace, x, y))
+ else if (rectangle_contains_point (&slider_trace, range_alloc.x + x, range_alloc.y + y))
priv->mouse_location = priv->trough_widget;
else if (rectangle_contains_point (&range_alloc, range_alloc.x + x, range_alloc.y + y))
priv->mouse_location = widget;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]