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 <ofourdan@redhat.com>
Reviewed-By: Kenny Levinsen <kl@kl.wtf>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1197>
This commit is contained in:
Olivier Fourdan 2023-11-28 14:45:55 +01:00
parent 54f8fc4090
commit 96fd7cc8c9
3 changed files with 5 additions and 5 deletions

View File

@ -664,8 +664,8 @@ dispatch_absolute_motion(struct xwl_seat *xwl_seat)
event_y *= xwl_screen->global_surface_scale; event_y *= xwl_screen->global_surface_scale;
if (xwl_window_has_viewport_enabled(xwl_seat->focus_window)) { if (xwl_window_has_viewport_enabled(xwl_seat->focus_window)) {
event_x *= xwl_seat->focus_window->scale_x; event_x *= xwl_seat->focus_window->viewport_scale_x;
event_y *= xwl_seat->focus_window->scale_y; event_y *= xwl_seat->focus_window->viewport_scale_y;
} }
x = drawable_x + event_x; x = drawable_x + event_x;

View File

@ -290,8 +290,8 @@ xwl_window_enable_viewport(struct xwl_window *xwl_window,
xwl_output->width, xwl_output->width,
xwl_output->height); xwl_output->height);
xwl_window->scale_x = (float) width / xwl_output->width; xwl_window->viewport_scale_x = (float) width / xwl_output->width;
xwl_window->scale_y = (float) height / xwl_output->height; xwl_window->viewport_scale_y = (float) height / xwl_output->height;
} }
static Bool static Bool

View File

@ -53,7 +53,7 @@ struct xwl_window {
struct xwl_screen *xwl_screen; struct xwl_screen *xwl_screen;
struct wl_surface *surface; struct wl_surface *surface;
struct wp_viewport *viewport; struct wp_viewport *viewport;
float scale_x, scale_y; float viewport_scale_x, viewport_scale_y;
struct xdg_surface *xdg_surface; struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel; struct xdg_toplevel *xdg_toplevel;
WindowPtr window; WindowPtr window;