From 59801ef854016cc85c6bcf8b6ed8a77081f433fb Mon Sep 17 00:00:00 2001 From: Emanuele Aina Date: Fri, 10 Aug 2012 20:47:46 +0200 Subject: [PATCH] drag-action: fix press coords transform with drag_handle When setting a drag handle, transform the original press coordinates using the drag handle as reference instead of the associated actor. This causes the initial misplacement of drag handle in example/drag-action when holding down the Shift key: the handle gets placed at the main actor origin on the first drag event, instead of following the mouse pointer. All subsequent motion events already use the right actor when transforming the coordinates, thus they are not affected. https://bugzilla.gnome.org/show_bug.cgi?id=681746 --- clutter/clutter-drag-action.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clutter/clutter-drag-action.c b/clutter/clutter-drag-action.c index a58ec4d37..a9aaa49e8 100644 --- a/clutter/clutter-drag-action.c +++ b/clutter/clutter-drag-action.c @@ -1106,6 +1106,12 @@ clutter_drag_action_set_drag_handle (ClutterDragAction *action, priv->drag_handle = handle; + priv->transformed_press_x = priv->press_x; + priv->transformed_press_y = priv->press_y; + clutter_actor_transform_stage_point (handle, priv->press_x, priv->press_y, + &priv->transformed_press_x, + &priv->transformed_press_y); + if (priv->drag_handle != NULL) g_signal_connect (priv->drag_handle, "destroy", G_CALLBACK (on_drag_handle_destroy),