qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Pierre Ossman <ossman@cendio.se>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vnc: track LED state separately
Date: Thu, 15 Dec 2016 17:41:16 +0100	[thread overview]
Message-ID: <1481820076.21413.23.camel@redhat.com> (raw)
In-Reply-To: <3fcc534530370027118377dc24d4049a1cef590e.1481807806.git.ossman@cendio.se>

On Do, 2016-12-15 at 14:16 +0100, Pierre Ossman wrote:
> Piggy-backing on the modifier state array made it difficult to send
> out updates at the proper times. So keep track of the LED state in
> a separate variable.
> 
> This also moves the handling up a layer in to the VNC Display object
> since the state is global, and also makes sure the state is readily
> available directly when a client connects.

Better, thanks.

>  static void kbd_leds(void *opaque, int ledstate)
>  {
> -    VncState *vs = opaque;
> -    int caps, num, scr;
> -    bool has_changed = (ledstate != current_led_state(vs));
> +    VncDisplay *vd = opaque;
> +    VncState *client;
>  
>      trace_vnc_key_guest_leds((ledstate & QEMU_CAPS_LOCK_LED),
>                               (ledstate & QEMU_NUM_LOCK_LED),
>                               (ledstate & QEMU_SCROLL_LOCK_LED));
>  
> -    caps = ledstate & QEMU_CAPS_LOCK_LED ? 1 : 0;
> -    num  = ledstate & QEMU_NUM_LOCK_LED  ? 1 : 0;
> -    scr  = ledstate & QEMU_SCROLL_LOCK_LED ? 1 : 0;
> +    if (ledstate != vd->ledstate)
> +        return;

Hmm?  Shouldn't that be (ledstate == vd->ledstate)?

cheers,
  Gerd

  reply	other threads:[~2016-12-15 16:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 13:16 [Qemu-devel] [PATCH] vnc: track LED state separately Pierre Ossman
2016-12-15 16:41 ` Gerd Hoffmann [this message]
2016-12-16  9:00   ` Pierre Ossman
2017-01-04  8:57     ` Gerd Hoffmann
2017-01-09 16:14       ` Pierre Ossman
  -- strict thread matches above, loose matches on Subject: below --
2017-01-09 16:14 Pierre Ossman
2017-01-10 11:40 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1481820076.21413.23.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=ossman@cendio.se \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).