diff options
author | Keith Packard <keithp@keithp.com> | 2011-08-06 19:06:42 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-08-06 19:06:42 -0700 |
commit | e68059e9ecc4225360a522138aedcedad7fe117f (patch) | |
tree | c8f06a32bd2c0daa1f65b6f13a8602591b3ce2ee | |
parent | 5185a18a016d9ccbfea3a3cdb314041268222708 (diff) |
xrandr: Preserve current mode when switching crtcs
When switching output crtcs, preserve any current mode in preference
to selecting whatever mode is currently in use on that crtc.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | xrandr.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1074,7 +1074,13 @@ set_output_info (output_t *output, RROutput xid, XRROutputInfo *output_info) /* set mode name and info */ if (!(output->changes & changes_mode)) { - if (output->crtc_info) + crtc_t *crtc = NULL; + + if (output_info->crtc) + crtc = find_crtc_by_xid(output_info->crtc); + if (crtc && crtc->crtc_info) + set_name_xid (&output->mode, crtc->crtc_info->mode); + else if (output->crtc_info) set_name_xid (&output->mode, output->crtc_info->crtc_info->mode); else set_name_xid (&output->mode, None); |