summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-06 19:06:42 -0700
committerKeith Packard <keithp@keithp.com>2011-08-06 19:06:42 -0700
commite68059e9ecc4225360a522138aedcedad7fe117f (patch)
treec8f06a32bd2c0daa1f65b6f13a8602591b3ce2ee
parent5185a18a016d9ccbfea3a3cdb314041268222708 (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.c8
1 files changed, 7 insertions, 1 deletions
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);