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

Use generic hot key combo for client control #1375

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Commits on Oct 14, 2022

  1. Log invalid screen layout

    To be able to debug exactly what is wrong with the layout. Unfortunately
    we don't know what log level is used for actual "invalid layout"
    message, or if it is even logged as all, since that happens elsewhere.
    So let's be cautious and use a debug log level here.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    ad89bad View commit details
    Browse the repository at this point in the history
  2. Move keyboard tracking to CConnection

    This is a general thing so move it in to the core library instead,
    letting vncviewer focus on just translation of system events to VNC
    ones.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    2c2ee11 View commit details
    Browse the repository at this point in the history
  3. Move keyboard handling to separate classes

    Encapsulate all the platform specific magic around keyboard in to
    specific classes, in order to keep the core code more readable.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    13d4e97 View commit details
    Browse the repository at this point in the history
  4. Update keysym header files

    This make sure we have any new defines, in case we want to use them.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    c19831d View commit details
    Browse the repository at this point in the history
  5. Add own keysym to name function

    This is mainly a copy of XKeysymToString() from libX11. We've also added
    a wrapper that still gives a string, even if there is no name for the
    requested keysym.
    
    This grows the binaries a bit, but not with any extreme amount so is
    hopefully worth it to get better debug logging.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    6e97a3b View commit details
    Browse the repository at this point in the history
  6. Better fix for fake focus grab events

    The fake ones have a special mode, so we can simply filter them before
    they are passed on as FLTK events.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    93da303 View commit details
    Browse the repository at this point in the history
  7. Use generic hot key combo for client control

    We want to be able to define more keyboard combinations that allows the
    user to control the client instead of sending the keys to the server.
    Instead of adding a never ending stream of random keys that just
    confuses things, we'll define a set of modifiers that are the base for
    all client control commands.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    32f0263 View commit details
    Browse the repository at this point in the history
  8. Add hot key for full screen

    Allows you to quickly enter and leave full-screen mode.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    ba830df View commit details
    Browse the repository at this point in the history
  9. Add a bypass for hot key combinations

    No matter how carefully you choose your hot key modifiers, there might
    still be situations where you need to send those hot key combinations to
    the server instead.
    
    This commit adds a method for this by letting the <hotkeys>+Space
    combination temporarily bypass the hot key logic and send everything to
    the server (until all keys are released again).
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    15a0d61 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a672958 View commit details
    Browse the repository at this point in the history
  11. Add hot key to grab keyboard

    Allows you to grab the keyboard input from the desktop environment even
    in windowed mode.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    511694b View commit details
    Browse the repository at this point in the history
  12. Add support for more overlays

    We want to show tips for more things, so rework the overlay
    infrastructure so it can handle an arbitrary amount of messages.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    9d8937f View commit details
    Browse the repository at this point in the history
  13. Add overlays for grab and full screen

    These modes can be non-obvious for users how to get out of, so show an
    overlay with how to get back to normal when these modes are enabled.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    9b7bcf6 View commit details
    Browse the repository at this point in the history
  14. Avoid repeating overlay tips

    It can get a bit annoying if you keep getting these constantly, so only
    show them again if enough time has passed since we last showed them.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    31e83e6 View commit details
    Browse the repository at this point in the history
  15. More dynamic window title cropping

    Let's add an ellipsis if we have to crop the title.
    
    Also reduce the maximum length to something reasonable. We want to do
    the cropping, not let the window manager do it, as otherwise "TigerVNC"
    might get cropped.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    815aafe View commit details
    Browse the repository at this point in the history
  16. Update window caption on grab

    Provide some UI feedback that the keyboard is currently grabbed and
    local input is prevented.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    e5021fe View commit details
    Browse the repository at this point in the history
  17. Synchronously retry X11 keyboard grab

    Make this less complex by removing the timer and retrying things
    synchronously. This can freeze the UI, but we give up after half a
    second so it should hopefully not be noticable.
    
    The advantage is that we can directly determine if we succeeded or
    failed grabbing the keyboard. The previous code could in theory continue
    retrying forever.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    4c8993b View commit details
    Browse the repository at this point in the history
  18. Show error grabbing keyboard

    It is now very likely that this happens as we will not have permission
    to do this by default on macOS. So present a message to the user so they
    understand why the keyboard isn't working as expected.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    9304d4f View commit details
    Browse the repository at this point in the history
  19. Handle macOS keyboard stealing

    The system steals keyboard events for certain system keyboard shortcuts,
    e.g. Cmd+Tab. Unfortunately this isn't considered a focus loss, so we
    don't realise we've lost a few keyboard events and can end up in a
    confused state.
    
    Fortunately it is possible to detect when this happens and reset the
    keyboard state, just like we do when focus is lost.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    a05b2e0 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    20ba98a View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    d990c54 View commit details
    Browse the repository at this point in the history
  22. Use event taps for keyboard grab on macOS

    These are the slightly more proper way to grab the keyboard and macOS
    and is what similar applications do. It avoids a lot of issues we have,
    e.g., problems with multiple monitors.
    
    Unfortunately we need to have the user explicitly approve this (which
    really is a good thing, security wise), and Apple have chosen to mark
    this feature as only for accessibility.
    CendioOssman committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    af825d3 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    d3487aa View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    ce81726 View commit details
    Browse the repository at this point in the history