提交 1483adcf 编写于 作者: L Lei Li 提交者: Anthony Liguori

vnc: Make ledstate comparison before modifiers updated

The ledstate should be compared before modifiers updated,
otherwise the ledstate would be the same as current_led_state.
Reported-by: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NLei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
Message-id: 1368606040-11950-1-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 800ced8c
......@@ -1601,6 +1601,7 @@ static void kbd_leds(void *opaque, int ledstate)
{
VncState *vs = opaque;
int caps, num, scr;
bool has_changed = (ledstate != current_led_state(vs));
caps = ledstate & QEMU_CAPS_LOCK_LED ? 1 : 0;
num = ledstate & QEMU_NUM_LOCK_LED ? 1 : 0;
......@@ -1617,7 +1618,7 @@ static void kbd_leds(void *opaque, int ledstate)
}
/* Sending the current led state message to the client */
if (ledstate != current_led_state(vs)) {
if (has_changed) {
vnc_led_state_change(vs);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册