[libchamplain] Fix 590727: Events are not send until the mouse move
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libchamplain] Fix 590727: Events are not send until the mouse move
- Date: Sun, 30 Aug 2009 16:32:42 +0000 (UTC)
commit dcd42a997d434423488bc854251693e416d95c89
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date: Sun Aug 30 12:22:08 2009 -0400
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.
champlain/champlain-view.c | 5 ++---
tidy/tidy-finger-scroll.c | 5 ++++-
2 files changed, 6 insertions(+), 4 deletions(-)
---
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]