diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-03-15 12:46:06 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2016-03-29 18:02:31 +0800 |
commit | aa7bc501d59feff5fbf2fd50edf0bb06948df90f (patch) | |
tree | 5ef421e2d13e59868afb13ad63b2660f12283eca /src/wayland/meta-wayland-buffer.c | |
parent | 623eb6eacce6e30dd3f7e51066a02dc43f5310ab (diff) | |
download | mutter-aa7bc501d59feff5fbf2fd50edf0bb06948df90f.tar.gz |
wayland: Replace buffer destroy wl_signal with a GObject signal
Don't use the libwayland-* utilities when we have our own that do the
same thing.
https://bugzilla.gnome.org/show_bug.cgi?id=762828
Diffstat (limited to 'src/wayland/meta-wayland-buffer.c')
-rw-r--r-- | src/wayland/meta-wayland-buffer.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c index 3fc536208..b59fd3007 100644 --- a/src/wayland/meta-wayland-buffer.c +++ b/src/wayland/meta-wayland-buffer.c @@ -30,6 +30,15 @@ #include <cogl/cogl-wayland-server.h> #include <meta/util.h> +enum +{ + RESOURCE_DESTROYED, + + LAST_SIGNAL +}; + +guint signals[LAST_SIGNAL]; + G_DEFINE_TYPE (MetaWaylandBuffer, meta_wayland_buffer, G_TYPE_OBJECT); static void @@ -40,7 +49,7 @@ meta_wayland_buffer_destroy_handler (struct wl_listener *listener, wl_container_of (listener, buffer, destroy_listener); buffer->resource = NULL; - wl_signal_emit (&buffer->destroy_signal, buffer); + g_signal_emit (buffer, signals[RESOURCE_DESTROYED], 0); g_object_unref (buffer); } @@ -82,7 +91,6 @@ meta_wayland_buffer_from_resource (struct wl_resource *resource) buffer = g_object_new (META_TYPE_WAYLAND_BUFFER, NULL); buffer->resource = resource; - wl_signal_init (&buffer->destroy_signal); buffer->destroy_listener.notify = meta_wayland_buffer_destroy_handler; wl_resource_add_destroy_listener (resource, &buffer->destroy_listener); } @@ -181,4 +189,11 @@ meta_wayland_buffer_class_init (MetaWaylandBufferClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = meta_wayland_buffer_finalize; + + signals[RESOURCE_DESTROYED] = g_signal_new ("resource-destroyed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, 0); } |