Extension protocols to support keyboard and mouse sharing?

2023-07-20 Thread Matt Hoosier
Hi,

For a while now, I’ve been hoping to see some commercial solutions like
https://symless.com/synergy that implement keyboard and mouse sharing
finally add support for running on DEs that use Wayland.

It seems to be forever on their feature roadmaps but never really getting
closer.

I assume the problem is lack of a good way to snoop on the input events and
(maybe; not sure how these commercial solutions implement it) rewrite or
suppress certain input events when they’re talking to a typical DE
compositor like Mutter.

I had a quick look through the current set of things in wayland-protocols,
and nothing jumped out at me as work in that direction.

Does anybody know of something underway in the upstream compositors that
might not have filtered down to wayland-protocols yet, which would be
useful for securely implementing mouse/keyboard sharing across separate
machines? Maybe I could point these vendors to it.


Re: Extension protocols to support keyboard and mouse sharing?

2023-07-20 Thread Jonas Ådahl
On Thu, Jul 20, 2023 at 01:47:47PM -0500, Matt Hoosier wrote:
> Hi,
> 
> For a while now, I’ve been hoping to see some commercial solutions like
> https://symless.com/synergy that implement keyboard and mouse sharing
> finally add support for running on DEs that use Wayland.
> 
> It seems to be forever on their feature roadmaps but never really getting
> closer.
> 
> I assume the problem is lack of a good way to snoop on the input events and
> (maybe; not sure how these commercial solutions implement it) rewrite or
> suppress certain input events when they’re talking to a typical DE
> compositor like Mutter.
> 
> I had a quick look through the current set of things in wayland-protocols,
> and nothing jumped out at me as work in that direction.
> 
> Does anybody know of something underway in the upstream compositors that
> might not have filtered down to wayland-protocols yet, which would be
> useful for securely implementing mouse/keyboard sharing across separate
> machines? Maybe I could point these vendors to it.

There is an ongoing, effort to achieve this with xdg-desktop-portal
APIs, where the intention is to allow a sandboxed input-leap (or in
theory synergy) to be able to act as both a server and client in a
Wayland session, while still actively requiring user consent. The pieces
that I know of that currently have implementations that ties it all
together are input-leap, xdg-desktop-portal, the GNOME portal backend
(xdg-desktop-portal-gnome & mutter).

The portals in question are input capture[1], for capturing the input
from a display server (to the input leap *server*), and remote
desktop[2], for remote controlling / injecting input events to a display
server (from the input leap *client*). The portal APIs rely on libei[3]
for input event transmission - the portals are there to negotiate
consent and to set up sessions.

It should be possible to use input-leap with mouse/keyboard sharing with
all the building blocks manually compiled, but nothing has shipped in
distributions yet.


Jonas

[1] https://github.com/flatpak/xdg-desktop-portal/pull/714
[2] 
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.RemoteDesktop
[3] https://gitlab.freedesktop.org/libinput/libei