Blame SOURCES/0011-Don-t-abort-if-XRRSetCrtcConfig-fails.patch

a547b4
From 96c00ebf666e044d0b53ad569dde3c24ce7b9b4d Mon Sep 17 00:00:00 2001
a547b4
From: Jonathon Jongsma <jjongsma@redhat.com>
a547b4
Date: Thu, 19 Dec 2013 11:31:21 -0600
a547b4
Subject: [PATCH] Don't abort if XRRSetCrtcConfig fails
a547b4
a547b4
In certain configurations (Fedora 20 or RHEL7 guests on a RHEL6 host), this call
a547b4
fails, which cause the vdagent to abort. This patch prevents the crash, though
a547b4
arbitrary resizing is obviously still non-functional in this situation.
a547b4
a547b4
https://bugzilla.redhat.com/show_bug.cgi?id=1066422
a547b4
(cherry picked from commit 6e2e82e6fbb8927d5154f32c83e2b95c08fef18e)
a547b4
---
a547b4
 src/vdagent-x11-randr.c | 4 ++--
a547b4
 1 file changed, 2 insertions(+), 2 deletions(-)
a547b4
a547b4
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
a547b4
index b1f9813..46367bc 100644
a547b4
--- a/src/vdagent-x11-randr.c
a547b4
+++ b/src/vdagent-x11-randr.c
a547b4
@@ -366,11 +366,11 @@ static int xrandr_add_and_set(struct vdagent_x11 *x11, int output, int x, int y,
a547b4
     x11->randr.monitor_sizes[output].width = width;
a547b4
     x11->randr.monitor_sizes[output].height = height;
a547b4
     outputs[0] = xid;
a547b4
+    vdagent_x11_set_error_handler(x11, error_handler);
a547b4
     s = XRRSetCrtcConfig(x11->display, x11->randr.res, x11->randr.res->crtcs[output],
a547b4
                          CurrentTime, x, y, mode->id, RR_Rotate_0, outputs,
a547b4
                          1);
a547b4
-
a547b4
-    if (s != RRSetConfigSuccess) {
a547b4
+    if (vdagent_x11_restore_error_handler(x11) || (s != RRSetConfigSuccess)) {
a547b4
         syslog(LOG_ERR, "failed to XRRSetCrtcConfig");
a547b4
         x11->set_crtc_config_not_functional = 1;
a547b4
         return 0;