xwayland: Track output scales

Keep track of the output scales as advertised by the wl_output protocol.

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-02 10:33:22 +01:00
parent 5b05a29912
commit 2bdf594cea
2 changed files with 4 additions and 1 deletions

View File

@ -725,6 +725,9 @@ output_handle_done(void *data, struct wl_output *wl_output)
static void static void
output_handle_scale(void *data, struct wl_output *wl_output, int32_t factor) output_handle_scale(void *data, struct wl_output *wl_output, int32_t factor)
{ {
struct xwl_output *xwl_output = data;
xwl_output->scale = factor;
} }
static void static void

View File

@ -54,7 +54,7 @@ struct xwl_output {
struct wl_output *output; struct wl_output *output;
struct zxdg_output_v1 *xdg_output; struct zxdg_output_v1 *xdg_output;
uint32_t server_output_id; uint32_t server_output_id;
int32_t x, y, width, height, refresh; int32_t x, y, width, height, refresh, scale;
int32_t mode_width, mode_height; int32_t mode_width, mode_height;
double xscale; /* Effective scale, can be fractional */ double xscale; /* Effective scale, can be fractional */
Rotation rotation; Rotation rotation;