[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] vnc: Support for LED state extension
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] vnc: Support for LED state extension |
Date: |
Wed, 15 May 2013 08:44:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
On 05/15/13 08:05, Lei Li wrote:
> On 05/14/2013 07:35 PM, Gerd Hoffmann wrote:
>> On 04/25/13 07:29, Lei Li wrote:
>>> + /* Sending the current led state message to the client */
>>> + if (ledstate != current_led_state(vs)) {
>>> + vnc_led_state_change(vs);
>>> + }
>> This check never becomes true as the vnc modifier/led state just got
>> updated to match ledstate ...
>
> Oh... then how about get rid of this check, let vnc_led_state_change send
> the current led state message directly?
Only sending an update if something did actually change makes sense I
think, but you need to check before updating the state, i.e. something
like this:
bool has_changed = ledstate != current_led_state(vs);
[ update modifiers/led state ]
if (has_changed)
vnc_led_state_change()
cheers,
Gerd