Bug 1337576

Summary: Avoid loosing sync and inserting invalid keystrokes for modifiers syncronizations
Product: Red Hat Enterprise Linux 7 Reporter: Frediano Ziglio <fziglio>
Component: spice-gtkAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.2CC: astepano, dblechte, fziglio, rbalakri, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-11 17:49:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1311804    

Description Frediano Ziglio 2016-05-19 14:06:10 UTC
Description of problem:
Caps locks is a strange key/concept. The concept of Caps lock and how to turn on/off can be quite different between guest and client. This, as client try to sync the modifiers causing even continue virtual keystrokes.


Version-Release number of selected component (if applicable):
Any


How reproducible:
Always in specific (many) conditions.
Use a English client on a Japanese guest and try to use Caps lock key.
Try setting modifier differently (for instance disabling caps lock on guest).


Steps to Reproduce:
Just as an instance
1. use a English client for virt-viewer (Linux for instance);
2. open a Japanese guest (Linux) with Eisu toggle key working;
3. press Caps lock key on client.
Try also to disable caps lock on either systems or remap to different key.

Actual results:
Key not working or continuously toggling.
This for Japanese users can cause impossibility to use some input methods.


Expected results:
Guest should work as you typed the keys on a physical machine.


Additional info:
We are following different paths from better knowledges of the guest settings (using the guest agent) to synchronize only on specific events (like focus in/out) and in different directions.

Comment 2 Andrei Stepanov 2016-06-03 12:40:40 UTC
Running on guest:

$ xev -event keyboard

shows that turning off CapsLock produces next events:


KeyPress event, serial 36, synthetic NO, window 0x2200001,
    root 0x276, subw 0x0, time 333796219, (77,68), root:(84,154),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2200001,
    root 0x276, subw 0x0, time 333796299, (77,68), root:(84,154),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x2200001,
    root 0x276, subw 0x0, time 333796299, (77,68), root:(84,154),
    state 0x0, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2200001,
    root 0x276, subw 0x0, time 333796299, (77,68), root:(84,154),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x2200001,
    root 0x276, subw 0x0, time 333796300, (77,68), root:(84,154),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2200001,
    root 0x276, subw 0x0, time 333796300, (77,68), root:(84,154),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False


Guest thinks that CapsLock was pressed 3 times instead one.

Comment 3 Andrei Stepanov 2016-06-03 13:00:20 UTC
[root@localhost ~]# xinput test 7
key press   38 <------ press a
key release 38 
akey press   66 <------- capslock On
key release 66 
key press   38 <------- press a
key release 38 
Akey press   66 <-------- capslock Off
key release 66 
key press   66 
key release 66 
key press   66 
key release 66

Comment 4 Frediano Ziglio 2016-11-11 17:49:31 UTC
Current release implements some workaround that works on most cases.