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,
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;