Confusing LED state behavior

15 views
Skip to first unread message

DRC

unread,
Aug 29, 2022, 4:05:49 PM8/29/22
to tigervn...@googlegroups.com
I observe that the TigerVNC Viewer and Server properly sync the LED
state, but a review of the code doesn't reveal how or why that occurs.
Because of
https://github.com/TigerVNC/tigervnc/blob/master/vncviewer/CConn.cxx#L89,
the viewer never notifies the server that it supports the LED
extensions, so the server never sends the viewer any LED state updates.
(Viewport::setLEDState() is never called.) Also, I observe that
Viewport::pushLEDState() is called in response to the window receiving
keyboard focus, but because cc->server.ledState() never changes from
ledUnknown to something else, Viewport::pushLEDState() is always a
no-op. And yet the LED state clearly is synchronizing. What am I missing?

DRC

Pierre Ossman

unread,
Aug 30, 2022, 4:20:34 AM8/30/22
to DRC, tigervn...@googlegroups.com
Oh, crap. That was debug code that was not supposed to be committed. The
viewer should of course notify the server that it supports it.

What you might be seeing is the fallback logic in the server:

https://github.com/TigerVNC/tigervnc/blob/0eab3508800445ae3cf31565bc5679aaaf5ac5ed/common/rfb/VNCSConnectionST.cxx#L526-L578

If you enable debug logging, you should see log lines when this
triggers. E.g.:

> Tue Aug 30 10:02:15 2022
> VNCSConnST: Key pressed: 0x41 / 0x1e
> VNCSConnST: Inserting fake CapsLock to get in sync with client
> Input: keycode 66 down
> Input: keycode 66 up
> Input: raw keycode 38 down
> VNCSConnST: Key released: 0x41 / 0x1e
> Input: raw keycode 38 up

Regards
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

DRC

unread,
Aug 30, 2022, 1:07:32 PM8/30/22
to tigervn...@googlegroups.com
On 8/30/22 3:20 AM, Pierre Ossman wrote:
> Oh, crap. That was debug code that was not supposed to be committed.
> The viewer should of course notify the server that it supports it.
>
> What you might be seeing is the fallback logic in the server:
>
> https://github.com/TigerVNC/tigervnc/blob/0eab3508800445ae3cf31565bc5679aaaf5ac5ed/common/rfb/VNCSConnectionST.cxx#L526-L578
>
>
> If you enable debug logging, you should see log lines when this
> triggers. E.g.:
>
>> Tue Aug 30 10:02:15 2022
>>  VNCSConnST:  Key pressed: 0x41 / 0x1e
>>  VNCSConnST:  Inserting fake CapsLock to get in sync with client
>>  Input:       keycode 66 down
>>  Input:       keycode 66 up
>>  Input:       raw keycode 38 down
>>  VNCSConnST:  Key released: 0x41 / 0x1e
>>  Input:       raw keycode 38 up

Indeed, that does appear to be what's happening.

DRC


Reply all
Reply to author
Forward
0 new messages