viewporter: fix "has buffer" check

Previously, cases when a viewport source box was updated without attaching
a buffer weren't checked for correctness properly because the state's buffer
would be NULL. Use wlr_surface_state_has_buffer() instead.
master
Kirill Primak 8 months ago committed by Simon Zeni
parent 538a7a190d
commit 072f6ed977

@ -158,7 +158,7 @@ static void viewport_handle_surface_client_commit(struct wl_listener *listener,
return;
}
if (state->viewport.has_src && state->buffer != NULL &&
if (state->viewport.has_src && wlr_surface_state_has_buffer(state) &&
!check_src_buffer_bounds(state)) {
wlr_surface_reject_pending(viewport->surface,
viewport->resource, WP_VIEWPORT_ERROR_OUT_OF_BUFFER,

Loading…
Cancel
Save