From e68059e9ecc4225360a522138aedcedad7fe117f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 6 Aug 2011 19:06:42 -0700 Subject: [PATCH] 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 --- xrandr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xrandr.c b/xrandr.c index 62b32d1..d35e451 100644 --- a/xrandr.c +++ b/xrandr.c @@ -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); -- 2.32.0.93.g670b81a890