<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><br></div><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Frediano,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 25, 2019 at 9:38 AM Frediano Ziglio <<a href="mailto:fziglio@redhat.com" target="_blank">fziglio@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> [...]<br><div><br></div>
I agree on the patch however to me it looks partial.<br><br>
When the server send the modifiers the client check its state<br>
and still does the sync.<br>
In my configuration my client does not change the caps lock state<br>
as the caps is used for other purposes. The caps in my case get<br>
ignored or it bounce back depending on how long I press the caps.<br><br></blockquote><div><br></div><div>So if I understand correctly, you have configured the [CAPSLock] key to something else than CAPS lock (using an xkb option, maybe compose:caps or something), so pressing [CAPSLock] on your host would not switch CAPS Lock ON on your host.</div></div></div></div></blockquote><div>Yes, sometimes I write something in Spanish which has a lot of accents and I have a Uk keyboard so I wanted some "sticky" keys. However always sticky is a problem as being a developer I want to have characters like ` and ' with one keystroke so I'm using caps lock as compose key (which is something you can do from Gnome/KDE without manually using xkb).<br></div><div><br></div><div>But beside my not common settings the commit specifies that modifiers synchronization does not happen when client has the focus but this is false in the path where modifiers are sent to the server.<br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div>Yet the guest may not have that option set, so when CAPSLock key press is received by the guest, it switches CAPS lock on the guest, so the guest and host status differ.</div></div></div></div></blockquote><div>Looking at code and how modifiers behave I found another issue (with or without this patch). On Linux (xorg and KDE but I suppose it's xorg) the caps modifier is reset when caps lock is released while on Windows caps modifier is reset when is pressed! The code on server assume the Windows behaviour. This causes a bounce of the caps (a virtual caps lock key press/release) if client is Linux, guest is Windows and you hold the caps lock a bit more than usual! The reason is that when the caps lock is pressed Windows turn the led, send "caps lock is disabled" to client while client has still the caps lock enabled so it tries to force the caps lock.<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div dir="ltr"><div class="gmail_quote">That would be a harder case to solve I think, because of the way sync works in spice-server (<a href="https://gitlab.freedesktop.org/spice/spice/merge_requests/3" target="_blank">https://gitlab.freedesktop.org/spice/spice/merge_requests/3</a>) as a toggle state, it's much harder to get the expected state reliably (also because in the opposite case, i.e. the guess has changed the default CAPS lock xkb option, simulating a [CAPSLock] key press as spice-server does may not enable CAPS Lock in the guest either).<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Cheers,</div><div class="gmail_quote">Olivier<br></div></div></div></blockquote><div>Frediano<br></div><div><br></div></div></body></html>