Skip to content
  • Olivier Fourdan's avatar
    xwayland: Apply output rotation for screen size · 058809c4
    Olivier Fourdan authored and Adam Jackson's avatar Adam Jackson committed
    Previously, we would swap the width/height of the Xwayland output based
    on the output rotation, so that the overall screen size would match the
    actual rotation of each output.
    
    Problem is the RandR's ConstrainCursorHarder() handler will also apply
    the output rotation, meaning that when the output is rotated, the
    pointer will be constrained within the wrong dimension.
    
    Moreover, XRandR assumes the original output width/height are unchanged
    when the output is rotated, so by changing the Xwayland output width and
    height based on rotation, Xwayland causes XRandr to report the wrong
    output sizes (an output of size 1024x768 rotated left or right should
    remain 1024x768, not 768x1024).
    
    So to avoid this issue and keep things consistent between Wayland and
    Xwayland outputs, leave the actual width/height unchanged but apply the
    rotation when computing the screen size. This fixes both the output size
    being wrong in "xrandr -q" and the pointer being constrained in the
    wrong dimension with rotated with weston.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
    
    
    Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    058809c4