Fixes bug: If an output's clone has already been connected to a crtc then the
current output will be connected to that crtc without checking
mismatched state (i.e. different positions).

Signed-off-by: Dasith Gunawardhana <[email protected]>
---
 xrandr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xrandr.c b/xrandr.c
index 2d4cb72..683ffda 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -1957,6 +1957,18 @@ check_crtc_for_output (crtc_t *crtc, output_t *output)
        /* not on the list, can't clone */
        if (l == output->output_info->nclone) 
            return False;
+
+    /* make sure the state matches the clone's state */
+    if (other->mode_info != output->mode_info)
+        return False;
+    if (other->x != output->x)
+        return False;
+    if (other->y != output->y)
+        return False;
+    if (other->rotation != output->rotation)
+        return False;
+    if (!equal_transform (&other->transform, &output->transform))
+        return False;
     }
 
     if (crtc->noutput)
-- 
2.15.0

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to