Received: from eggs.gnu.org ([2001:4830:134:3::10]:53995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN04d-0001T1-Uu for qemu-devel@nongnu.org; Mon, 10 Mar 2014 09:17:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN04V-000131-3q for qemu-devel@nongnu.org; Mon, 10 Mar 2014 09:16:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN04U-00012r-SI for qemu-devel@nongnu.org; Mon, 10 Mar 2014 09:16:47 -0400 From: Gerd Hoffmann Date: Mon, 10 Mar 2014 14:16:39 +0100 Message-Id: <1394457400-31756-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1394457400-31756-1-git-send-email-kraxel@redhat.com> References: <1394457400-31756-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/3] spice: QemuUIInfo windup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 2a1fbda..e28698c 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -543,10 +543,29 @@ static void interface_set_client_capabilities(QXLInstance *sin, } static int interface_client_monitors_config(QXLInstance *sin, - VDAgentMonitorsConfig *monitors_config) + VDAgentMonitorsConfig *mc) { - dprint(3, "%s:\n", __func__); - return 0; /* == not supported by guest */ + SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl); + QemuUIInfo info; + int rc; + + /* + * FIXME: multihead is tricky due to the way + * spice has multihead implemented. + */ + memset(&info, 0, sizeof(info)); + if (mc->num_of_monitors > 0) { + info.width = mc->monitors[0].width; + info.height = mc->monitors[0].height; + } + rc = dpy_set_ui_info(ssd->dcl.con, &info); + dprint(1, "%s/%d: size %dx%d, rc %d <--- ==========================\n", + __func__, ssd->qxl.id, info.width, info.height, rc); + if (rc != 0) { + return 0; /* == not supported by guest */ + } else { + return 1; + } } static const QXLInterface dpy_interface = { -- 1.8.3.1