mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 18:08:03 +02:00
Only update the surface size if a new buffer is attached
This fixes a regression caused by either918f2dd4orda75ee1d. In particular, if a client called commit without attaching a buffer and if the compositor had already released its reference to the buffer, then a size of 0x0 would be set on the surface. In particular, this affects the wayland backend because it frequently sends only a frame request in order to cause a refresh. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
c180977e7c
commit
81038fba86
1 changed files with 6 additions and 6 deletions
|
|
@ -2110,10 +2110,10 @@ weston_surface_commit(struct weston_surface *surface)
|
|||
surface->buffer_viewport = surface->pending.buffer_viewport;
|
||||
|
||||
/* wl_surface.attach */
|
||||
if (surface->pending.buffer || surface->pending.newly_attached)
|
||||
if (surface->pending.buffer || surface->pending.newly_attached) {
|
||||
weston_surface_attach(surface, surface->pending.buffer);
|
||||
|
||||
weston_surface_set_size_from_buffer(surface);
|
||||
weston_surface_set_size_from_buffer(surface);
|
||||
}
|
||||
|
||||
if (surface->configure && surface->pending.newly_attached)
|
||||
surface->configure(surface,
|
||||
|
|
@ -2336,12 +2336,12 @@ weston_subsurface_commit_from_cache(struct weston_subsurface *sub)
|
|||
surface->buffer_viewport = sub->cached.buffer_viewport;
|
||||
|
||||
/* wl_surface.attach */
|
||||
if (sub->cached.buffer_ref.buffer || sub->cached.newly_attached)
|
||||
if (sub->cached.buffer_ref.buffer || sub->cached.newly_attached) {
|
||||
weston_surface_attach(surface, sub->cached.buffer_ref.buffer);
|
||||
weston_surface_set_size_from_buffer(surface);
|
||||
}
|
||||
weston_buffer_reference(&sub->cached.buffer_ref, NULL);
|
||||
|
||||
weston_surface_set_size_from_buffer(surface);
|
||||
|
||||
if (surface->configure && sub->cached.newly_attached)
|
||||
surface->configure(surface, sub->cached.sx, sub->cached.sy);
|
||||
sub->cached.sx = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue