Blob Blame History Raw
From 44592b47a60b943b0e0990ad82644e7b9a2091ad Mon Sep 17 00:00:00 2001
From: Victor Toso <me@victortoso.com>
Date: Thu, 15 Nov 2018 16:47:33 +0100
Subject: [PATCH] vdagent: Do not send empty screen resolution messages

Easier to trigger on Wayland guest by running

> xrandr --output XWAYLAND0 --rotate left

In current master, this causes the spice-vdagentd to disconnect from
the client. In 0.18 branch (latest release), mouse becomes unusable as
mentioned in the referred bug below.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1641723

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 src/vdagent/x11-randr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
index 803cf73..708f060 100644
--- a/src/vdagent/x11-randr.c
+++ b/src/vdagent/x11-randr.c
@@ -974,6 +974,12 @@ no_info:
         }
     }
 
+    if (screen_count == 0) {
+        syslog(LOG_DEBUG, "Screen count is zero, are we on wayland?");
+        g_free(res);
+        return;
+    }
+
     if (x11->debug) {
         for (i = 0; i < screen_count; i++)
             syslog(LOG_DEBUG, "Screen %d %dx%d%+d%+d", i, res[i].width,
-- 
2.19.1