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:
Jonas Ådahl
2016-02-26 17:47:21 +08:00
parent 43bd057754
commit d340c3a6dd
4 changed files with 40 additions and 48 deletions

View File

@ -153,7 +153,6 @@ struct _MetaWaylandSurface
MetaWindow *window;
MetaWaylandBuffer *buffer;
gboolean using_buffer;
struct wl_listener buffer_destroy_listener;
cairo_region_t *input_region;
cairo_region_t *opaque_region;
int scale;