wstroke icon indicating copy to clipboard operation
wstroke copied to clipboard

Is Wayfire compatibility close to Wayland compatibiltiy?

Open ttytm opened this issue 4 years ago • 2 comments

Hey just seen your work. Very nice development here. Using easy stroke like a lunatic I'm looking for a possibility to have a mouse gesture app on Wayland?

Is what you created here close to a Wayland compatibility? I didn'T use Wayfire yet and couldn't tell how far a Wayland compatibility is from there?

In any way could you make it Wayland compatible? All coffee on me for this one.

Sending love and blessings. Keep the good work up

ttytm avatar Dec 15 '21 18:12 ttytm

Hi,

thanks for your interest! Unfortunately, it is not possible to have "Wayland compatibility" in a general way, since there is no general (or at least widely supported) way to track the mouse position and carry out general actions in the way required by Easystroke. This is mostly intentional, since this kind of access has security implications, a potential issue under X11. Several Wayland compositors integrate main desktop functionality in their main process for this reason. Wstroke follows this pattern, being integrated into Wayfire as a plugin. Currently, this works well for my purposes.

That being said, I see several options to support Easystroke-like gestures in other compositors beyond Wayfire:

  • Create a new Wayland protocol that allows an external program to handle gestures (basically track the mouse and carry out some actions, like send keypresses). This would allow a generic way to have an Easystroke port that works on all compositors that support this new protocol, but you would have to convince compositor developers to actually support such a protocol. This would have the security issues mentioned above, but there are already protocols that allow clients to perform privileged actions and some discussion on a mechanism to restrict access to security critical protocols, e.g. here. It could make sense to raise this issue in the wayland-protocols repository, mentioning that you're interested in Easystroke-like mouse gestures generally.
  • Port wstroke to other compositors beyond Wayfire. Actually, I don't think this has to be difficult, at least for compositors written in C/C++: what you need is to hook into the code handling mouse events, while the rest of the codebase (outside of easystroke_gestures.cpp can likely be reused without much changes). What could be an issue is that you have to compile everything together, so this needs either support from the compositor devs or an existing infrastructure for external plugins as it is the case with Wayfire. This can become more difficult if C++ plugins are not supported, e.g. GNOME Shell only supports extensions written in JavaScript; in theory, porting the gesture code could be possible though, just more work
  • Try to run unmodified Easystroke with XWayland -- this did not work for me, but other Easystroke users had some success

dkondor avatar Dec 15 '21 21:12 dkondor

Hello! Thank you so much for the reply and the further explanations. It helps a lot to be able to put it into context. I have made contact with a few developers and see what comes out of it. As far as I can see it my intends were humbled and I'm planning to stay with X11 for a longer time and see what the next year brings. Have a good weekend my friend!

ttytm avatar Dec 16 '21 23:12 ttytm