From 96fd7cc8c99b065dbbe7fc2ab0f2f93e841e01ae Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 28 Nov 2023 14:45:55 +0100 Subject: [PATCH] xwayland: Rename scale_x/y to viewport_scale_x/y The scale_x/y factor applies when a viewport is in use, rename the fields to reflect that and distinguish these from the other scale factors such as the core protocol surface scale and the fractional scaling. Signed-off-by: Olivier Fourdan Reviewed-By: Kenny Levinsen Acked-by: Peter Hutterer Part-of: --- hw/xwayland/xwayland-input.c | 4 ++-- hw/xwayland/xwayland-window.c | 4 ++-- hw/xwayland/xwayland-window.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index cf0ca87b0..502581425 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -664,8 +664,8 @@ dispatch_absolute_motion(struct xwl_seat *xwl_seat) event_y *= xwl_screen->global_surface_scale; if (xwl_window_has_viewport_enabled(xwl_seat->focus_window)) { - event_x *= xwl_seat->focus_window->scale_x; - event_y *= xwl_seat->focus_window->scale_y; + event_x *= xwl_seat->focus_window->viewport_scale_x; + event_y *= xwl_seat->focus_window->viewport_scale_y; } x = drawable_x + event_x; diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index e83ca8a2c..00cdbdd58 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -290,8 +290,8 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window, xwl_output->width, xwl_output->height); - xwl_window->scale_x = (float) width / xwl_output->width; - xwl_window->scale_y = (float) height / xwl_output->height; + xwl_window->viewport_scale_x = (float) width / xwl_output->width; + xwl_window->viewport_scale_y = (float) height / xwl_output->height; } static Bool diff --git a/hw/xwayland/xwayland-window.h b/hw/xwayland/xwayland-window.h index 7c70bb9ed..2873ab707 100644 --- a/hw/xwayland/xwayland-window.h +++ b/hw/xwayland/xwayland-window.h @@ -53,7 +53,7 @@ struct xwl_window { struct xwl_screen *xwl_screen; struct wl_surface *surface; struct wp_viewport *viewport; - float scale_x, scale_y; + float viewport_scale_x, viewport_scale_y; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; WindowPtr window;