From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCodg-0007uy-AI for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:44:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCodb-0000C7-C3 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:44:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCodb-0000C3-6Y for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:44:15 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BEFD33B70E for ; Tue, 14 Jun 2016 13:44:14 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Tue, 14 Jun 2016 15:44:08 +0200 Message-Id: <1465911849-30423-3-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1465911849-30423-1-git-send-email-marcandre.lureau@redhat.com> References: <1465911849-30423-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/3] spice: use the right head for multi-monitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Look up the associated head monitor config. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/spice-display.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 34095fb..142c941 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -686,6 +686,7 @@ static int interface_client_monitors_config(QXLInstan= ce *sin, { SimpleSpiceDisplay *ssd =3D container_of(sin, SimpleSpiceDisplay, qx= l); QemuUIInfo info; + int head; =20 if (!dpy_ui_info_supported(ssd->dcl.con)) { return 0; /* =3D=3D not supported by guest */ @@ -695,14 +696,12 @@ static int interface_client_monitors_config(QXLInst= ance *sin, return 1; } =20 - /* - * 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 =3D mc->monitors[0].width; - info.height =3D mc->monitors[0].height; + + head =3D qemu_console_get_head(ssd->dcl.con); + if (mc->num_of_monitors > head) { + info.width =3D mc->monitors[head].width; + info.height =3D mc->monitors[head].height; } dpy_set_ui_info(ssd->dcl.con, &info); dprint(1, "%s/%d: size %dx%d\n", __func__, ssd->qxl.id, --=20 2.7.4