From patchwork Thu Apr 25 05:29:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Li X-Patchwork-Id: 239394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9473C2C0100 for ; Thu, 25 Apr 2013 15:30:14 +1000 (EST) Received: from localhost ([::1]:55341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVEl2-0002KR-Nm for incoming@patchwork.ozlabs.org; Thu, 25 Apr 2013 01:30:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVEkV-0002Gh-9Z for qemu-devel@nongnu.org; Thu, 25 Apr 2013 01:29:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVEkU-0003Xp-Ai for qemu-devel@nongnu.org; Thu, 25 Apr 2013 01:29:39 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:39719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVEkT-0003XZ-PQ for qemu-devel@nongnu.org; Thu, 25 Apr 2013 01:29:38 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Apr 2013 15:21:41 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Apr 2013 15:21:40 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 847572CE804C for ; Thu, 25 Apr 2013 15:29:33 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3P5TRvF13959198 for ; Thu, 25 Apr 2013 15:29:27 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3P5TWhD001927 for ; Thu, 25 Apr 2013 15:29:32 +1000 Received: from localhost.localdomain ([9.77.177.213]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3P5TLXi001780; Thu, 25 Apr 2013 15:29:30 +1000 From: Lei Li To: qemu-devel@nongnu.org Date: Thu, 25 Apr 2013 13:29:11 +0800 Message-Id: <1366867752-11578-4-git-send-email-lilei@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1366867752-11578-1-git-send-email-lilei@linux.vnet.ibm.com> References: <1366867752-11578-1-git-send-email-lilei@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13042505-5490-0000-0000-000003583FC4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.144 Cc: lagarcia@br.ibm.com, aliguori@us.ibm.com, kraxel@redhat.com, Lei Li Subject: [Qemu-devel] [PATCH 3/4] vnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Lei Li --- ui/vnc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 44189d7..9ffa75b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1613,7 +1613,11 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) break; } + /* Turn off the lock state sync logic if the client support the led + state extension. + */ if (down && vs->vd->lock_key_sync && + !vnc_has_feature(vs, VNC_FEATURE_LED_STATE) && keycode_is_keypad(vs->vd->kbd_layout, keycode)) { /* If the numlock state needs to change then simulate an additional keypress before sending this one. This will happen if the user @@ -1633,6 +1637,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) } if (down && vs->vd->lock_key_sync && + !vnc_has_feature(vs, VNC_FEATURE_LED_STATE) && ((sym >= 'A' && sym <= 'Z') || (sym >= 'a' && sym <= 'z'))) { /* If the capslock state needs to change then simulate an additional keypress before sending this one. This will happen if the user