From 66a4d21096d469d988d5ff6b8f988b1de80a6c89 Mon Sep 17 00:00:00 2001 From: "Alejandro G. Castro" Date: Tue, 10 Mar 2009 13:13:12 +0000 Subject: [PATCH] 2009-03-10 Alejandro G. Castro * src/hildon-pannable-area.c, (hildon_pannable_area_motion_notify_cb): We control that the direction error margin is used just in case the movement is allowed in the other direction. Fixes: NB#105012 (Check boxes don't change state when toggled) --- ChangeLog | 9 +++++++++ src/hildon-pannable-area.c | 22 ++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ba8239..3a7d433 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,15 @@ 2009-03-10 Alejandro G. Castro * src/hildon-pannable-area.c, + (hildon_pannable_area_motion_notify_cb): We control that the + direction error margin is used just in case the movement is + allowed in the other direction. + + Fixes: NB#105012 (Check boxes don't change state when toggled) + +2009-03-10 Alejandro G. Castro + + * src/hildon-pannable-area.c, (hildon_pannable_area_class_init), (hildon_pannable_area_get_property), (hildon_pannable_area_set_property), diff --git a/src/hildon-pannable-area.c b/src/hildon-pannable-area.c index 5da996c..813c1b7 100644 --- a/src/hildon-pannable-area.c +++ b/src/hildon-pannable-area.c @@ -2255,10 +2255,11 @@ hildon_pannable_area_motion_notify_cb (GtkWidget * widget, y = 0; if (priv->first_drag) { + gboolean vscroll_visible; + gboolean hscroll_visible; if (ABS (priv->iy - event->y) >= ABS (priv->ix - event->x)) { - gboolean vscroll_visible; g_signal_emit (area, pannable_area_signals[VERTICAL_MOVEMENT], @@ -2273,14 +2274,18 @@ hildon_pannable_area_motion_notify_cb (GtkWidget * widget, if (!((vscroll_visible)&& (priv->mov_mode&HILDON_MOVEMENT_MODE_VERT))) { + hscroll_visible = (priv->hadjust->upper - priv->hadjust->lower > + priv->hadjust->page_size); + /* even in case we do not have to move we check if this could be a fake horizontal movement */ - if (ABS (priv->iy - event->y) - - ABS (priv->ix - event->x) >= priv->direction_error_margin) + if (!((hscroll_visible)&& + (priv->mov_mode&HILDON_MOVEMENT_MODE_HORIZ)) || + (ABS (priv->iy - event->y) - + ABS (priv->ix - event->x) >= priv->direction_error_margin)) priv->moved = FALSE; } } else { - gboolean hscroll_visible; g_signal_emit (area, pannable_area_signals[HORIZONTAL_MOVEMENT], @@ -2295,10 +2300,15 @@ hildon_pannable_area_motion_notify_cb (GtkWidget * widget, if (!((hscroll_visible)&& (priv->mov_mode&HILDON_MOVEMENT_MODE_HORIZ))) { + vscroll_visible = (priv->vadjust->upper - priv->vadjust->lower > + priv->vadjust->page_size); + /* even in case we do not have to move we check if this could be a fake vertical movement */ - if (ABS (priv->ix - event->x) - - ABS (priv->iy - event->y) >= priv->direction_error_margin) + if (!((vscroll_visible) && + (priv->mov_mode&HILDON_MOVEMENT_MODE_VERT)) || + (ABS (priv->ix - event->x) - + ABS (priv->iy - event->y) >= priv->direction_error_margin)) priv->moved = FALSE; } } -- 1.7.9.5