From d1c88a22a363620f9eb1a6286f01c7aac197f260 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 24 Nov 2023 16:48:34 +0100 Subject: viewporter: rename state var in viewport_handle_surface_commit() "current" is misleading, since we are using the pending state here. --- types/wlr_viewporter.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/wlr_viewporter.c b/types/wlr_viewporter.c index 9e743d59..a4a0d92d 100644 --- a/types/wlr_viewporter.c +++ b/types/wlr_viewporter.c @@ -136,22 +136,22 @@ static void viewport_handle_surface_commit(struct wl_listener *listener, struct wlr_viewport *viewport = wl_container_of(listener, viewport, surface_commit); - struct wlr_surface_state *current = &viewport->surface->pending; + struct wlr_surface_state *state = &viewport->surface->pending; - if (!current->viewport.has_dst && - (floor(current->viewport.src.width) != current->viewport.src.width || - floor(current->viewport.src.height) != current->viewport.src.height)) { + if (!state->viewport.has_dst && + (floor(state->viewport.src.width) != state->viewport.src.width || + floor(state->viewport.src.height) != state->viewport.src.height)) { wl_resource_post_error(viewport->resource, WP_VIEWPORT_ERROR_BAD_SIZE, "wl_viewport.set_source width and height must be integers " "when the destination rectangle is unset"); return; } - if (current->viewport.has_src && current->buffer != NULL && - (current->viewport.src.x + current->viewport.src.width > - current->buffer_width || - current->viewport.src.y + current->viewport.src.height > - current->buffer_height)) { + if (state->viewport.has_src && state->buffer != NULL && + (state->viewport.src.x + state->viewport.src.width > + state->buffer_width || + state->viewport.src.y + state->viewport.src.height > + state->buffer_height)) { wl_resource_post_error(viewport->resource, WP_VIEWPORT_ERROR_OUT_OF_BUFFER, "source rectangle out of buffer bounds"); return; -- cgit v1.2.3