[libshumate] layer: Don't block mouse events to lower layers



commit ca6e1bbe551362d719e01ead49e449ebd36e7e0b
Author: James Westman <james jwestman net>
Date:   Tue Aug 2 20:47:16 2022 -0500

    layer: Don't block mouse events to lower layers

 shumate/shumate-layer.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/shumate/shumate-layer.c b/shumate/shumate-layer.c
index 6b92f97..767f1da 100644
--- a/shumate/shumate-layer.c
+++ b/shumate/shumate-layer.c
@@ -107,6 +107,16 @@ shumate_layer_constructed (GObject *object)
   G_OBJECT_CLASS (shumate_layer_parent_class)->constructed (object);
 }
 
+static gboolean
+shumate_layer_contains (GtkWidget *widget,
+                        double     x,
+                        double     y)
+{
+  /* This allows mouse events on the empty space between markers in this layer
+   * to fall through to lower layers. */
+  return FALSE;
+}
+
 static void
 shumate_layer_class_init (ShumateLayerClass *klass)
 {
@@ -118,6 +128,8 @@ shumate_layer_class_init (ShumateLayerClass *klass)
   object_class->dispose = shumate_layer_dispose;
   object_class->constructed = shumate_layer_constructed;
 
+  widget_class->contains = shumate_layer_contains;
+
   obj_properties[PROP_VIEWPORT] =
     g_param_spec_object ("viewport",
                          "Viewport",


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