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 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 From: Lei Li Date: Thu, 25 Apr 2013 13:29:11 +0800 Message-Id: <1366867752-11578-4-git-send-email-lilei@linux.vnet.ibm.com> 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> Subject: [Qemu-devel] [PATCH 3/4] vnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lagarcia@br.ibm.com, aliguori@us.ibm.com, kraxel@redhat.com, Lei Li 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 -- 1.7.7.6