aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-11-24 16:48:34 +0100
committerKirill Primak <vyivel@eclair.cafe>2023-11-26 11:56:28 +0000
commitd1c88a22a363620f9eb1a6286f01c7aac197f260 (patch)
tree8ecdcac7d52444a9e6bfa546ce2b699af9aa435f
parent87346b3393f9c38430b34f548a806e54c116686f (diff)
viewporter: rename state var in viewport_handle_surface_commit()
"current" is misleading, since we are using the pending state here.
-rw-r--r--types/wlr_viewporter.c18
1 files 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;