From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKjhM-0005Qh-7b for qemu-devel@nongnu.org; Wed, 06 Jul 2016 06:04:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKjhJ-0002Ew-8H for qemu-devel@nongnu.org; Wed, 06 Jul 2016 06:04:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKjhJ-0002EZ-1Y for qemu-devel@nongnu.org; Wed, 06 Jul 2016 06:04:49 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 A1BE5C04B306 for ; Wed, 6 Jul 2016 10:04:48 +0000 (UTC) From: Gerd Hoffmann Date: Wed, 6 Jul 2016 12:04:41 +0200 Message-Id: <1467799482-26420-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1467799482-26420-1-git-send-email-kraxel@redhat.com> References: <1467799482-26420-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 8/9] 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann From: Marc-Andr=C3=A9 Lureau Look up the associated head monitor config. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-id: 1465911849-30423-3-git-send-email-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann --- 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 8644a73..67e50e9 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -688,6 +688,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 */ @@ -697,14 +698,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 1.8.3.1