mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
frontend: Fix VNC mirror screen rotation
The following config allows to mirror the LVDS output to VNC: |[output] |name=LVDS-1 |transform=rotate-270 | |[output] |name=vnc |mirror-of=LVDS-1 However, the current code only takes the scale into account, not the relative transformation. In case of rotate 90 or 270 the width and height have to be swapped. Add it. Closes: https://gitlab.freedesktop.org/wayland/weston/-/issues/1076 Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
This commit is contained in:
parent
d69e816b54
commit
c6484574a6
1 changed files with 15 additions and 0 deletions
|
|
@ -3331,6 +3331,21 @@ wet_output_compute_output_from_mirror(struct weston_output *output,
|
|||
mode->height = output->native_mode_copy.height /
|
||||
mirror->current_scale;
|
||||
|
||||
/* Switch width and height for transform 90 or 270 */
|
||||
switch (output->transform) {
|
||||
case WL_OUTPUT_TRANSFORM_90:
|
||||
case WL_OUTPUT_TRANSFORM_270:
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
|
||||
case WL_OUTPUT_TRANSFORM_FLIPPED_270: {
|
||||
int32_t tmp = mode->width;
|
||||
mode->width = mode->height;
|
||||
mode->height = tmp;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
mode->refresh = output->native_mode_copy.refresh;
|
||||
*scale = output->current_scale;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue