[mutter/wip/xwayland-2] wayland: Kill the buffer destroy error



commit 817cb9cb6f01fefc5e20f8de003a3cd9d04dd5ed
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Mar 20 13:20:47 2014 -0400

    wayland: Kill the buffer destroy error
    
    After talking with Wayland upstrea a lot, they don't like it and
    want the ability for clients to flat out destroy SHM buffers
    without getting a release first.
    
    I really do not like this, but they set the rules. We just follow
    them.

 src/wayland/meta-wayland-surface.c |   21 ++-------------------
 src/wayland/meta-wayland-surface.h |    1 -
 2 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 940c32f..73c6701 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -75,16 +75,6 @@ typedef struct
 } MetaWaylandSubsurfacePlacementOp;
 
 static void
-surface_handle_buffer_destroy (struct wl_listener *listener, void *data)
-{
-  MetaWaylandSurface *surface = wl_container_of (listener, surface, buffer_destroy_listener);
-
-  wl_resource_post_error (surface->resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
-                          "Destroyed buffer while it was attached to the surface");
-  surface->buffer = NULL;
-}
-
-static void
 surface_set_buffer (MetaWaylandSurface *surface,
                     MetaWaylandBuffer  *buffer)
 {
@@ -92,18 +82,12 @@ surface_set_buffer (MetaWaylandSurface *surface,
     return;
 
   if (surface->buffer)
-    {
-      meta_wayland_buffer_unref (surface->buffer);
-      wl_list_remove (&surface->buffer_destroy_listener.link);
-    }
+    meta_wayland_buffer_unref (surface->buffer);
 
   surface->buffer = buffer;
 
   if (surface->buffer)
-    {
-      meta_wayland_buffer_ref (surface->buffer);
-      wl_signal_add (&surface->buffer->destroy_signal, &surface->buffer_destroy_listener);
-    }
+    meta_wayland_buffer_ref (surface->buffer);
 }
 
 static void
@@ -618,7 +602,6 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
   surface->resource = wl_resource_create (client, &wl_surface_interface, version, id);
   wl_resource_set_implementation (surface->resource, &meta_wayland_surface_interface, surface, 
wl_surface_destructor);
 
-  surface->buffer_destroy_listener.notify = surface_handle_buffer_destroy;
   surface->surface_actor = g_object_ref_sink (meta_surface_actor_wayland_new (surface));
 
   double_buffered_state_init (&surface->pending);
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index e088653..f956be9 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -81,7 +81,6 @@ struct _MetaWaylandSurface
   MetaWaylandSurfaceExtension subsurface;
 
   MetaWaylandBuffer *buffer;
-  struct wl_listener buffer_destroy_listener;
 
   GList *subsurfaces;
 


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