From: Pierre-Luc Beaudoin Date: Tue, 28 Jul 2009 00:37:33 +0000 (-0400) Subject: Eat selection events X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8456654633ff2fd8013a60891548ace4390da408;p=libchamplain Eat selection events This prevents unreactive (by user) markers to pass the click event to the stage to unselect all markers. --- diff --git a/champlain/champlain-selection-layer.c b/champlain/champlain-selection-layer.c index c2e7cc1..4a4ac79 100644 --- a/champlain/champlain-selection-layer.c +++ b/champlain/champlain-selection-layer.c @@ -169,7 +169,7 @@ marker_clicked_cb (ClutterActor *actor, real_select (CHAMPLAIN_SELECTION_LAYER (user_data), CHAMPLAIN_BASE_MARKER (actor), (event->modifier_state & CLUTTER_CONTROL_MASK)); - return FALSE; + return TRUE; } static void diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index e168df6..75fcda3 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -938,18 +938,22 @@ button_release_cb (ClutterActor *actor, ChamplainView *view) { GList *children = NULL; + gboolean found = FALSE; ChamplainViewPrivate *priv = view->priv; children = clutter_container_get_children (CLUTTER_CONTAINER (priv->user_layers)); for (;children != NULL; children = g_list_next (children)) { if (CHAMPLAIN_IS_SELECTION_LAYER (children->data)) - champlain_selection_layer_unselect_all (CHAMPLAIN_SELECTION_LAYER (children->data)); + { + champlain_selection_layer_unselect_all (CHAMPLAIN_SELECTION_LAYER (children->data)); + found = TRUE; + } } g_list_free (children); - return FALSE; + return found; }