]> err.no Git - libchamplain/commitdiff
Fix 590727: Events are not send until the mouse move
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 30 Aug 2009 16:22:08 +0000 (12:22 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 30 Aug 2009 16:22:08 +0000 (12:22 -0400)
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.

champlain/champlain-view.c
tidy/tidy-finger-scroll.c

index e1bfaae08f1603987e207c96bbe19a993ac6f194..a7e4e0adc3aecf18e2bbd4419c3f101631fb21c7 100644 (file)
@@ -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);
index e92843a51bcc26cc99ea89350f4b5b409c46fbd9..18cc6f6e91f1fbc6c6ba826f13d7ed794ab37e96 100644 (file)
@@ -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);