diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-05-23 15:35:00 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-06-14 16:59:04 +0200 |
commit | 5f67178c9602ed43f83f35a6d3097eb137244493 (patch) | |
tree | 935b76209575c46195a97c4391ca5dc3a7aa9e87 | |
parent | 0fb74ae1a7fd8ffbf0d353bb5e5c7c2aabd1ab27 (diff) |
win32: don't block key up events
The win32 ll keyboard hook avoid Windows and other application to
receive global keyboard events. But some key combinations can't be
filtered, such as Win+L. However, the windows lock screen doesn't catch
that the Win key is released, when virt-viewer still holds the hook and
filters it.
So pressing Win+L quickly will lock the screen, but some key press in
the password entry will still be handled as if the Win key was pressed,
such as Win+P or Win+U and probably other, and prevents user from typing
his password.
The only working solution I could find is to just let go all the release
key events in the hook. There doesn't seem any drawback with that.
https://bugzilla.redhat.com/show_bug.cgi?id=917986
-rw-r--r-- | gtk/spice-widget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index 1b5f8c3..d25edca 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -659,7 +659,7 @@ void spice_display_set_grab_keys(SpiceDisplay *display, SpiceGrabSequence *seq) #ifdef WIN32 static LRESULT CALLBACK keyboard_hook_cb(int code, WPARAM wparam, LPARAM lparam) { - if (win32_window && code == HC_ACTION) { + if (win32_window && code == HC_ACTION && wparam == WM_KEYDOWN) { KBDLLHOOKSTRUCT *hooked = (KBDLLHOOKSTRUCT*)lparam; DWORD dwmsg = (hooked->flags << 24) | (hooked->scanCode << 16) | 1; |