summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-11-28 14:45:55 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2024-03-20 09:05:36 +0100
commit96fd7cc8c99b065dbbe7fc2ab0f2f93e841e01ae (patch)
tree2db5767ce832458fff0183890d6b6d65f8287392
parent54f8fc409091ea3b3466cbf948a53194aaa26aad (diff)
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>
-rw-r--r--hw/xwayland/xwayland-input.c4
-rw-r--r--hw/xwayland/xwayland-window.c4
-rw-r--r--hw/xwayland/xwayland-window.h2
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;