[libchamplain] Eat selection events



commit 8456654633ff2fd8013a60891548ace4390da408
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date:   Mon Jul 27 20:37:33 2009 -0400

    Eat selection events
    
    This prevents unreactive (by user) markers to pass the
    click event to the stage to unselect all markers.

 champlain/champlain-selection-layer.c |    2 +-
 champlain/champlain-view.c            |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
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;
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]