compositor: add wlr_surface_state_has_buffer()

This commit is contained in:
Simon Ser 2023-12-12 11:36:11 +01:00
parent 43734f7c62
commit 34d5af4172
2 changed files with 18 additions and 1 deletions

View file

@ -720,7 +720,11 @@ struct wlr_texture *wlr_surface_get_texture(struct wlr_surface *surface) {
}
bool wlr_surface_has_buffer(struct wlr_surface *surface) {
return surface->current.buffer_width > 0 && surface->current.buffer_height > 0;
return wlr_surface_state_has_buffer(&surface->current);
}
bool wlr_surface_state_has_buffer(const struct wlr_surface_state *state) {
return state->buffer_width > 0 && state->buffer_height > 0;
}
void wlr_surface_map(struct wlr_surface *surface) {