Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows start/win key 'sticks' after switching between Windows virtual desktops #1578

Open
msummerfield opened this issue Jan 10, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@msummerfield
Copy link

msummerfield commented Jan 10, 2023

Describe the bug
When I have TigerVNC open full screen on its own Windows virtual desktop, switching to another desktop and back via Ctl-Win-arrow keys causes the Win key to behave as if it is stuck down. It can be 'unstuck' by sending a valid Win-key combination through to Windows then returning focus to the TigerVNC display.

To Reproduce

  1. Set up multiple virtual desktops within Windows
  2. Open TigerVNC full screen on one virtual desktop
  3. Leaving TigerVNC open full screen, switch to a different Windows virtual desktop using Ctl-Win-(left or right)arrow
  4. Switch back using Ctl-Win(right or left)arrow
  5. Try to type in TigerVNC
  6. PC will behave as if Win key is held down. Behaviour persists even outside of TigerVNC, but can be fixed by sending a valid Win-key combination to Windows (Win-A, which opens the notification bar, is a reasonably harmless choice for this).

Note that to perform steps 3 and 6 you might need a second display in which TigerVNC is not running, so that you can click on the Windows desktop to give input focus back for Windows to receive the Win-key combinations. Minimising TigerVNC to perform these steps does not trigger the bug.

The behaviour does not occur if TigerVNC is minimised, or running in a Window rather than full screen. The behaviour does not occur in other VNC clients (e.g. Real VNC vncviewer).

Expected behavior
Keyboard behaviour should not change after switching between virtual desktops.

Screenshots
N/A

Client (please complete the following information):

  • OS: Windows 10
  • TigerVNC
  • VNC client version: 1.12.0
  • Client downloaded from: SourceForge

Server (please complete the following information):

  • OS: Ubuntu 18.04 LTS
  • VNC server: x11vnc

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@CendioOssman
Copy link
Member

It took me a few attempts, but I was finally able to see what you mean here.

I misunderstood that you meant that the Win key got stuck in the session (a common bug), not that it was stuck locally on the client.

There must be something in our keyboard grab code that confuses Windows. I assume it doesn't happen if "Send system keys..." is disabled?

Does the RealVNC client have the feature to grab the keyboard?

Have you tried any other client that can grab the keyboard, but doesn't trigger this bug?

@CendioOssman CendioOssman added the bug Something isn't working label Jan 17, 2023
@msummerfield
Copy link
Author

Yes, if I disable 'Send system keys...' the issue does not occur. But of course I then get Windows responding to the keys as well as the server.

I believe that the RealVNC client grabs the keyboard. Its default setting is to send all keys (except audio/volume controls) directly to the VNC server.

I have also tried the UltraVNC client, which does not exhibit this bug.

@CendioOssman
Copy link
Member

RealVNC is unfortunately proprietary, so we can't see how they handle the keyboard grab. I had a look at UltraVNC. They use the same system hooks, but they have a very different approach to handling the events.

Someone will unfortunately need to dig in to this a bit and try to figure out the details of where it goes wrong.

@bob333
Copy link

bob333 commented Apr 14, 2023

This occurs on Ubuntu 22.04 + i3 window manger + single monitor. Windows key is grabbed after full screen. Tested with client version "v1.13.1" connection to the tigervncserver v 1.11.0 running on debian machine.

@CendioOssman
Copy link
Member

The issue reported here is very specific for a Windows client. If you are seeing something similar on Linux, then please open a new issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants