From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKHQm-0003HG-G1 for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKHQh-0003DK-Qe for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:07 -0500 Received: from [199.232.76.173] (port=45612 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKHQh-0003DG-IY for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:03 -0500 Received: from e5.ny.us.ibm.com ([32.97.182.145]:48096) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NKHQh-0007V9-Bt for qemu-devel@nongnu.org; Mon, 14 Dec 2009 15:22:03 -0500 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by e5.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id nBEKAJBG023398 for ; Mon, 14 Dec 2009 15:10:19 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBEKLodN142736 for ; Mon, 14 Dec 2009 15:21:50 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBEKLnCZ008441 for ; Mon, 14 Dec 2009 18:21:50 -0200 From: Anthony Liguori Date: Mon, 14 Dec 2009 14:21:41 -0600 Message-Id: <1260822101-29530-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH] vnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Yaniv Kaul This violates the RFB specification (section 6.6.4). It happens to work with most clients but it's still wrong. Reported-by: Yaniv Kaul Signed-off-by: Anthony Liguori --- vnchextile.h | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/vnchextile.h b/vnchextile.h index c96ede3..432ed89 100644 --- a/vnchextile.h +++ b/vnchextile.h @@ -73,7 +73,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, *last_bg = bg; } - if (!*has_fg || *last_fg != fg) { + if (n_colors < 3 && (!*has_fg || *last_fg != fg)) { flags |= 0x04; *has_fg = 1; *last_fg = fg; @@ -165,8 +165,6 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, irow += ds_get_linesize(vs->ds) / sizeof(pixel_t); } - /* A SubrectsColoured subtile invalidates the foreground color */ - *has_fg = 0; if (n_data > (w * h * sizeof(pixel_t))) { n_colors = 4; flags = 0x01; -- 1.6.2.5