[Spice-devel] Handle JP keyboard with spice-gtk from Windows client

Takao Fujiwara tfujiwar at redhat.com
Thu Mar 31 11:36:34 UTC 2016


I noticed Linux GNOME desktop hangs up when Windows virt-viewer connects to the desktop and type some specific keys on JP keyboard.

Server: GNOME desktop and IBus in RHEL 7
Client virt-viewer in Windows 7 with JP 106 keyboard

When I see the key events with 'xev' command in GNOME desktop, I observed the unlimited too many key events of Zenkaku_Hankaku key and it caused the
desktop freeze.
The attached three patches resolves the desktop issues.

1. spice-gtk-1311820-01-zkhk.patch
Zenkaku_Hankaku key has the different virtual-key codes between WM_KEYDOWN and WM_KEYUP and MapVirtualKey() cannot get the scancode from virtual-key
code of WM_KEYDOWN (VK_OEM_ENLW) and spice-gtk didn't send the key press events and caused the desktop freeze with unlimited key release events.

The fix is to get the scancode from virtual-key code of WM_KEYUP (VK_OEM_AUTO) and Zenkaku_Hankaku key works fine.

Alt + Zenkaku_Hankaku key also has the different virtual-key code and MapVirtualKey() cannot get the
scancode from the virtual-key and spice-gtk didn't send the key press events and Alt+Zenkaku_Hankaku could not be used.

The fix is to get the scancode from virtual-key code of Zenkaku_Hankaku key (VK_OEM_AUTO).

VK_CAPITAL, VK_OEM_BACKTAB are also applied the similar fixes.

2. spice-gtk-1311820-02-freeze.patch
After spice-gtk-1311820-01-zkhk.patch is applied, WM_KEYDOWN of Alt+Zenkaku_Hankaku (VK_KANJI) can be sent with spice-gtk but Alt+Zenkaku_Hankaku did
not send the WM_KEYUP event in Windows and it caused Linux desktop freeze with unlimited key press events.

The fix is to send the key release event in spice-gtk.

VK_OEM_ATTN, VK_OEM_COPY, VK_OEM_BACKTAB are applied the similar fixes.

3. spice-gtk-1311820-03-hangul.patch
This is an additional fix. Korean keyboard assigns Hangul key on the position of Right Alt and Left Alt and Hangul keys have the different scancodes
but MapVirtualKey() returned the same scancode and could not use Hangul key on Linux desktop.

The fix is to send the right scancode of VK_HANGUL.

Thanks,
Fujiwara
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-gtk-1311820-01-zkhk.patch
Type: text/x-diff
Size: 3613 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160331/11066141/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-gtk-1311820-02-freeze.patch
Type: text/x-diff
Size: 1967 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160331/11066141/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-gtk-1311820-03-hangul.patch
Type: text/x-diff
Size: 1149 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160331/11066141/attachment-0005.patch>


More information about the Spice-devel mailing list