Skip to content
  • Pekka Paalanen's avatar
    Redefine output rotations · 8060d826
    Pekka Paalanen authored and Daniel Stone's avatar Daniel Stone committed
    It was discovered in issue #99 that the implementations of the 90 and 270
    degree rotations were actually the inverse of what the Wayland specification
    spelled out. This patch fixes the libweston implementation to follow the
    specification.
    
    As a result, the behaviour of the the weston.ini transform key also changes. To
    force all users to re-think their configuration, the transform key values are
    also changed. Since Weston and libweston change their behaviour, the handling
    of clients' buffer transform changes too.
    
    All the functions had their 90/270 cases simply swapped, probably due to
    confusion of whether WL_OUTPUT_TRANSFORM_* refers to rotating the monitor or
    the content.
    
    Hint: a key to understanding weston_matrix_rotate_xy(m, c, s) is that the
    rotation matrix is formed as
    
      c -s
      s  c
    
    that is, it's column-major. This fooled me at first.
    
    Fixing window.c fixes weston-terminal and weston-transformed.
    
    In simple-damage, window_get_transformed_ball() is fixed to follow the proper
    transform definitions, but the fix to the viewport path in redraw() is purely
    mechanical.  The viewport path looks broken to me in the presence of any
    transform, but it is not this patch's job to fix it.
    
    Screen-share fix just repeats the general code fix pattern, I did not even try
    to understand that bit.
    
    #99
    
    
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    8060d826