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

Draft: RFC: add inputcapture trigger for shortcuts and immediate capture #1035

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Jun 8, 2023

  1. remote-desktop: add the ability to communicate via an EIS socket

    This is intended as replacement for the NotifyFoo methods. libei
    provides a more flexible and powerful method of sending input events to
    the compositor.
    
    A new method ConnectToEIS requests a file descriptor from the compositor
    which can then be plugged into libei.
    
    Once established, the communication between compositor and application
    is direct, without the need to go through the portal process(es).
    
    To avoid ambiguities between NotifyFoo and input events sent via libei,
    any application that uses an EIS connection may not use the NotifyFoo
    methods.
    
    Co-authored-by: Olivier Fourdan <[email protected]>
    whot and ofourdan committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    4627418 View commit details
    Browse the repository at this point in the history
  2. Add the InputCapture portal

    This portal is aimed at allowing applications to capture input from
    physical devices, the prime use case is the server component of an
    InputLeap (a Synergy fork) setup where local devices are used to control
    a remote display.
    
    The general flow for the InputCapture session is:
    - application queries the "zones" available (usually representing the
      desktop)
    - application sets up "pointer barriers"
    - application provides a libei-compatible handle for the actual input
      events
    - when a cursor moves against/across a pointer barrier, the compositor
      notifies the client and re-routes input events from libinput to libei
      instead of controlling the local cursor
    
    Notable: the actual input events are not part of the portal here,
    they're handled by the direct libei connection between compositor and
    application. This portal has no direct dependencies on libei itself.
    
    The compositor is in charge of everything - it can restrict some screens
    from showing up in the regions, it can deny pointer barriers at
    locations, it decides when a pointer barrier is crossed, it can stop
    capturing (or filter events) at any time, etc.
    whot committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    67126fc View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2023

  1. inputcapture: Add SetEnableTrigger for immediate enabling of capture

    This allows an application to effectively say "start capturing now" once
    it calls Enable at some later point. The trigger is separate from the
    Enable call to a) make it more obvious that is what we want and b) allow
    for user interaction if need be. The process thus is:
    
    -> CreateSession
      <- session handle
    -> SetEnableTrigger
      <- compositor says yes
    -> Enable
      <- compositor says Activated
      <- captured input flows
    
    As with pointer barriers, the exact conditions for enabling the session
    are compositor implementation details but one would expect that having
    focus is a base requirement.
    
    In the Activated/Deactivated case, the capture session effectively
    remains. Where the session is Disabled (by compositor or application,
    e.g. on focus out) the application can immediately call SetEnableTrigger
    + Enable to get capture going again whenever it's convenient (e.g. on
    focus in).
    
    Unlike pointer barriers, zones do not apply for this case.
    whot committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    a8f8046 View commit details
    Browse the repository at this point in the history
  2. inputcapture: Add SetGlobalShortcuts trigger

    This requires an active GlobalShortcuts session with the requested
    shortcut(s) to be active - this call re-uses the shortcut ids from that
    session.
    
    When the input capture session is enabled and the compositor deems
    the shortcut to be triggered, capture starts.
    whot committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    83f393a View commit details
    Browse the repository at this point in the history