Skip to content
  • Hans de Goede's avatar
    xwayland: Fix emulated modes not being removed when screen rotation is used · 88342353
    Hans de Goede authored
    
    
    The code building the mode-list does the following to deal with screen
    rotation:
    
        if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
            mode_width = xwl_output->width;
            mode_height = xwl_output->height;
        } else {
            mode_width = xwl_output->height;
            mode_height = xwl_output->width;
        }
    
    This means we need to do something similar in xwl_output_set_emulated_mode()
    to determine if the mode being set is the actual (not-emulated) output mode
    and we this should remove any emulated modes set by the client.
    
    All callers of xwl_output_set_emulated_mode always pass a mode pointer
    to a member of xwl_output->randr_output->modes, so we do not need to
    duplicate this code, instead we can simply check that the passed in mode
    is modes[0] which always is the actual output mode.
    
    Acked-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    88342353