|
|
79df40 |
From ba76ed7d519a45b7f9b331a28e0617b919c9805e Mon Sep 17 00:00:00 2001
|
|
|
79df40 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
79df40 |
Date: Fri, 25 Sep 2020 14:04:31 -0400
|
|
|
79df40 |
Subject: [PATCH 3/4] barriers: Free backend implementation at dispose time
|
|
|
79df40 |
|
|
|
79df40 |
When a MetaBarrier is first created it allocates a backend
|
|
|
79df40 |
impl object which does the actual heavy lifting.
|
|
|
79df40 |
|
|
|
79df40 |
Unfortunately, that backend object is never freed.
|
|
|
79df40 |
|
|
|
79df40 |
This commit ensures the implementation gets freed when
|
|
|
79df40 |
the barrier object is freed.
|
|
|
79df40 |
|
|
|
79df40 |
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1451
|
|
|
79df40 |
---
|
|
|
79df40 |
src/backends/meta-barrier.c | 3 +++
|
|
|
79df40 |
1 file changed, 3 insertions(+)
|
|
|
79df40 |
|
|
|
79df40 |
diff --git a/src/backends/meta-barrier.c b/src/backends/meta-barrier.c
|
|
|
79df40 |
index 2353ef150..65abf7cab 100644
|
|
|
79df40 |
--- a/src/backends/meta-barrier.c
|
|
|
79df40 |
+++ b/src/backends/meta-barrier.c
|
|
|
79df40 |
@@ -94,67 +94,70 @@ meta_barrier_set_property (GObject *object,
|
|
|
79df40 |
{
|
|
|
79df40 |
case PROP_DISPLAY:
|
|
|
79df40 |
priv->display = g_value_get_object (value);
|
|
|
79df40 |
break;
|
|
|
79df40 |
case PROP_X1:
|
|
|
79df40 |
priv->border.line.a.x = g_value_get_int (value);
|
|
|
79df40 |
break;
|
|
|
79df40 |
case PROP_Y1:
|
|
|
79df40 |
priv->border.line.a.y = g_value_get_int (value);
|
|
|
79df40 |
break;
|
|
|
79df40 |
case PROP_X2:
|
|
|
79df40 |
priv->border.line.b.x = g_value_get_int (value);
|
|
|
79df40 |
break;
|
|
|
79df40 |
case PROP_Y2:
|
|
|
79df40 |
priv->border.line.b.y = g_value_get_int (value);
|
|
|
79df40 |
break;
|
|
|
79df40 |
case PROP_DIRECTIONS:
|
|
|
79df40 |
meta_border_set_allows_directions (&priv->border,
|
|
|
79df40 |
g_value_get_flags (value));
|
|
|
79df40 |
break;
|
|
|
79df40 |
default:
|
|
|
79df40 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
79df40 |
break;
|
|
|
79df40 |
}
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
static void
|
|
|
79df40 |
meta_barrier_dispose (GObject *object)
|
|
|
79df40 |
{
|
|
|
79df40 |
MetaBarrier *barrier = META_BARRIER (object);
|
|
|
79df40 |
+ MetaBarrierPrivate *priv = barrier->priv;
|
|
|
79df40 |
|
|
|
79df40 |
if (meta_barrier_is_active (barrier))
|
|
|
79df40 |
{
|
|
|
79df40 |
meta_bug ("MetaBarrier %p was destroyed while it was still active.",
|
|
|
79df40 |
barrier);
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
+ g_clear_object (&priv->impl);
|
|
|
79df40 |
+
|
|
|
79df40 |
G_OBJECT_CLASS (meta_barrier_parent_class)->dispose (object);
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
gboolean
|
|
|
79df40 |
meta_barrier_is_active (MetaBarrier *barrier)
|
|
|
79df40 |
{
|
|
|
79df40 |
MetaBarrierImpl *impl = barrier->priv->impl;
|
|
|
79df40 |
|
|
|
79df40 |
if (impl)
|
|
|
79df40 |
return META_BARRIER_IMPL_GET_CLASS (impl)->is_active (impl);
|
|
|
79df40 |
else
|
|
|
79df40 |
return FALSE;
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
/**
|
|
|
79df40 |
* meta_barrier_release:
|
|
|
79df40 |
* @barrier: The barrier to release
|
|
|
79df40 |
* @event: The event to release the pointer for
|
|
|
79df40 |
*
|
|
|
79df40 |
* In XI2.3, pointer barriers provide a feature where they can
|
|
|
79df40 |
* be temporarily released so that the pointer goes through
|
|
|
79df40 |
* them. Pass a #MetaBarrierEvent to release the barrier for
|
|
|
79df40 |
* this event sequence.
|
|
|
79df40 |
*/
|
|
|
79df40 |
void
|
|
|
79df40 |
meta_barrier_release (MetaBarrier *barrier,
|
|
|
79df40 |
MetaBarrierEvent *event)
|
|
|
79df40 |
{
|
|
|
79df40 |
MetaBarrierImpl *impl = barrier->priv->impl;
|
|
|
79df40 |
|
|
|
79df40 |
--
|
|
|
79df40 |
2.26.2
|
|
|
79df40 |
|