wayland: Don't unset surface->buffer when wl_buffer destroyed
Don't unset the surface->buffer if the associated wl_buffer object is destroyed. The MetaWaylandBuffer doesn't really only represent a wl_buffer object, but also the data (texture) created from the given wl_buffer. Thus, for example destroying a released SHM wl_buffer should not destroy the MetaWaylandBuffer instance, because the texture may still be used. This commit also fixes a race where calc_showing would hide a window because, at the time of calculation whether it should be showing, the surface's buffer had been destroyed as described above. https://bugzilla.gnome.org/show_bug.cgi?id=762716
This commit is contained in:
@ -33,18 +33,21 @@
|
||||
|
||||
struct _MetaWaylandBuffer
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
struct wl_resource *resource;
|
||||
struct wl_signal destroy_signal;
|
||||
struct wl_listener destroy_listener;
|
||||
|
||||
CoglTexture *texture;
|
||||
uint32_t ref_count;
|
||||
uint32_t use_count;
|
||||
};
|
||||
|
||||
#define META_TYPE_WAYLAND_BUFFER (meta_wayland_buffer_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaWaylandBuffer, meta_wayland_buffer,
|
||||
META, WAYLAND_BUFFER, GObject);
|
||||
|
||||
MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource);
|
||||
void meta_wayland_buffer_ref (MetaWaylandBuffer *buffer);
|
||||
void meta_wayland_buffer_unref (MetaWaylandBuffer *buffer);
|
||||
void meta_wayland_buffer_ref_use_count (MetaWaylandBuffer *buffer);
|
||||
void meta_wayland_buffer_unref_use_count (MetaWaylandBuffer *buffer);
|
||||
CoglTexture * meta_wayland_buffer_ensure_texture (MetaWaylandBuffer *buffer);
|
||||
|
Reference in New Issue
Block a user