[PATCH xserver] xwayland: don't use logical size for RRMode
Olivier Fourdan
fourdan at gmail.com
Mon Jul 9 14:42:50 UTC 2018
Hi,
On Mon, 9 Jul 2018 at 09:17, Simon Ser <contact at emersion.fr> wrote:
>
> The logical size is the size of the output in the global compositor
> space. The mode width/height shouldn't be transformed and scaled.
>
> This fixes issues with pointer input on transformed outputs.
>
> Signed-Off-By: Simon Ser <contact at emersion.fr>
> ---
> hw/xwayland/xwayland-output.c | 9 ++++++---
> hw/xwayland/xwayland.h | 3 ++-
> 2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
> index 379062549..44fd5c26a 100644
> --- a/hw/xwayland/xwayland-output.c
> +++ b/hw/xwayland/xwayland-output.c
> @@ -113,12 +113,15 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
> if (!(flags & WL_OUTPUT_MODE_CURRENT))
> return;
>
> + xwl_output->mode_width = width;
> + xwl_output->mode_height = height;
> + xwl_output->mode_refresh = refresh;
So, with that patch mode_width/height reflects the wl_output size.
> +
> /* Apply the change from wl_output only if xdg-output is not supported */
> if (!xwl_output->xdg_output) {
> xwl_output->width = width;
> xwl_output->height = height;
> }
> - xwl_output->refresh = refresh;
> }
>
> static inline void
> @@ -224,8 +227,8 @@ apply_output_change(struct xwl_output *xwl_output)
> /* xdg-output sends output size in compositor space. so already rotated */
> need_rotate = (xwl_output->xdg_output == NULL);
>
> - randr_mode = xwayland_cvt(xwl_output->width, xwl_output->height,
> - xwl_output->refresh / 1000.0, 0, 0);
> + randr_mode = xwayland_cvt(xwl_output->mode_width, xwl_output->mode_height,
> + xwl_output->mode_refresh / 1000.0, 0, 0);
And we'd advertise wl_ouput size as RR size? That's not how it's meant
to work, we want RR to reflect the xdg-output (logical) size.
> RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1);
> RRCrtcNotify(xwl_output->randr_crtc, randr_mode,
> xwl_output->x, xwl_output->y,
> diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
> index d70ad54bf..66daf58de 100644
> --- a/hw/xwayland/xwayland.h
> +++ b/hw/xwayland/xwayland.h
> @@ -368,7 +368,8 @@ struct xwl_output {
> struct xwl_screen *xwl_screen;
> RROutputPtr randr_output;
> RRCrtcPtr randr_crtc;
> - int32_t x, y, width, height, refresh;
> + int32_t x, y, width, height;
> + int32_t mode_width, mode_height, mode_refresh;
> Rotation rotation;
> Bool wl_output_done;
> Bool xdg_output_done;
> --
> 2.18.0
So, can you please elaborate exactly what this is supposed to fix and
how to reproduce the issue?
Cheers,
Olivier
More information about the xorg-devel
mailing list