From: Pierre-Luc Beaudoin Date: Sun, 30 Aug 2009 16:22:08 +0000 (-0400) Subject: Fix 590727: Events are not send until the mouse move X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcd42a997d434423488bc854251693e416d95c89;p=libchamplain Fix 590727: Events are not send until the mouse move Do not grab the mouse when the source actor is not the current actor, resulting in the event being passed down, but also in that you cannot drag the map starting on an actor anymore). Connecting the signal handlers on an object at the same or lower level than fingerscroll fixed the transmission of events. --- diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index e1bfaae..a7e4e0a 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -993,12 +993,11 @@ champlain_view_init (ChamplainView *view) clutter_container_add_actor (CLUTTER_CONTAINER (priv->viewport), priv->map_layer); - clutter_actor_set_reactive (CLUTTER_ACTOR (priv->stage), TRUE); - g_signal_connect_after (G_OBJECT (priv->stage), "button-release-event", - G_CALLBACK (button_release_cb), view); g_signal_connect (priv->finger_scroll, "button-press-event", G_CALLBACK (finger_scroll_button_press_cb), view); + g_signal_connect_after (priv->finger_scroll, "button-release-event", + G_CALLBACK (button_release_cb), view); clutter_stage_set_key_focus (CLUTTER_STAGE (clutter_stage_get_default()), priv->finger_scroll); diff --git a/tidy/tidy-finger-scroll.c b/tidy/tidy-finger-scroll.c index e92843a..18cc6f6 100644 --- a/tidy/tidy-finger-scroll.c +++ b/tidy/tidy-finger-scroll.c @@ -553,7 +553,7 @@ button_release_event_cb (ClutterActor *actor, if (moved == FALSE) clutter_event_put ((ClutterEvent *)event); - return TRUE; + return moved; } static gboolean @@ -587,6 +587,9 @@ captured_event_cb (ClutterActor *actor, TidyFingerScrollMotion *motion; ClutterButtonEvent *bevent = (ClutterButtonEvent *)event; + if (bevent->source != actor) + return FALSE; + /* Reset motion buffer */ priv->last_motion = 0; motion = &g_array_index (priv->motion_buffer, TidyFingerScrollMotion, 0);