From 8d9bbe109b16969557672330da0d6a26adc8eae2 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Fri, 14 Feb 2020 20:04:28 +0100 Subject: [PATCH] wayland/surface: Swap 90 and 270 degree transforms Our internal interpretation of output transforms is not in line with the Wayland spec. Wayland describes them as the transform that a compositor will apply to a surface to compensate for the rotation or mirroring of an output device - counter-clockwise. Mutter in turn interprets it the other way around. One could argue it does the same but clock-wise - or it interprets the transform from the viewpoint of the content, not the device. In either way, the difference is that 90 and 270 degree values are switched. Thus swap these accordingly when we translate from `WL_OUTPUT_TRANSFORM` to `META_MONITOR_TRANSFORM`. See: https://gitlab.freedesktop.org/wayland/weston/issues/99 Part-of: --- src/wayland/meta-wayland-surface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 3516ffd84..d7f198a1e 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -1191,19 +1191,19 @@ transform_from_wl_output_transform (int32_t transform_value) case WL_OUTPUT_TRANSFORM_NORMAL: return META_MONITOR_TRANSFORM_NORMAL; case WL_OUTPUT_TRANSFORM_90: - return META_MONITOR_TRANSFORM_90; + return META_MONITOR_TRANSFORM_270; case WL_OUTPUT_TRANSFORM_180: return META_MONITOR_TRANSFORM_180; case WL_OUTPUT_TRANSFORM_270: - return META_MONITOR_TRANSFORM_270; + return META_MONITOR_TRANSFORM_90; case WL_OUTPUT_TRANSFORM_FLIPPED: return META_MONITOR_TRANSFORM_FLIPPED; case WL_OUTPUT_TRANSFORM_FLIPPED_90: - return META_MONITOR_TRANSFORM_FLIPPED_90; + return META_MONITOR_TRANSFORM_FLIPPED_270; case WL_OUTPUT_TRANSFORM_FLIPPED_180: return META_MONITOR_TRANSFORM_FLIPPED_180; case WL_OUTPUT_TRANSFORM_FLIPPED_270: - return META_MONITOR_TRANSFORM_FLIPPED_270; + return META_MONITOR_TRANSFORM_FLIPPED_90; default: return -1; }