[PATCH spice-gtk] win32: don't block key up events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
---
 gtk/spice-widget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index c05b600..04a90e6 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;
 
-- 
1.8.3.rc1.49.g8d97506

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]