Whoa: Weston, the reference compositor for #Wayland, supports multiple physical independent mice at the same time! 😀
"New mouse, who dis?"
(See toot later in the thread for how to set this up!)
Whoa: Weston, the reference compositor for #Wayland, supports multiple physical independent mice at the same time! 😀
"New mouse, who dis?"
(See toot later in the thread for how to set this up!)
There are couple of surprises around window interaction:
- Once a cursor starts to resize/move a window, those actions are not possible for the other one.
- One cursor can open a menu, and the other one can use it, that one works pretty well!
- Closing a window with one cursor, while the other drags it, makes the second one *disappear*! :D
I mean, these are really hard UI questions to solve! Often, it's not clear to me what the correct behavior should be!
Okay, let's try some applications, and see how they deal with multiple mice! 😈
First up: Gedit, a GTK application.
Both cursors can place the cursor and select text, but movement from one cursor "interrupts" the selection of the other one. Not very satisfying.
Imagine how cool it would be if both had their own selections + cursors!! That would allow a really neat form of collaboration within the same document!
Next up: Chromium! It has a very pragmatic solution: It just *ignores* all cursors but the first one!
In the video, the arrow-shaped cursor can click on stuff. The turtle has no power here.
In Firefox, it seems like all mouse events are mashed together, and are seen as coming from the same device.
That means that both cursors can click – if the other one "holds still". Otherwise, I guess Firefox is very confused by a click on a link while the mouse is not in it! 😆
Selections feel strange – the last-moving cursor will determine the selection.
Also notice how, if one cursor hovers a link, *both* turn into hand icons!
Of course, we *had* to try a drawing application next!
Here's @tldraw (in Firefox)!
Collaborative drawing at it's best! 💚
Finally, I tried attaching an additional keyboard and assigned them to a different "seat"!
That worked really well! In Weston, each "seat" has its own keyboard focus, so you can actually work side-by-side with two mice + two keyboards independently!
Also!!! The two seats have their own (independent) clipboards!!!! Whatttt! 🤯
I totally didn't expect this. But multi-seat as a concept seems deeply integrated into libinput + #Wayland! Now it's up to GUI toolkits and compositors to support it!
Tried it again, and the independent clipboards still seem a bit glitchy after all… :(
An issue asking for proper support in GTK was closed five years ago, for example… https://gitlab.gnome.org/GNOME/gtk/-/issues/1574
Very useful when your very long line of code doesn't fit on your screen, for example! :P
(Shout-out to @xssfox, who first did this on X.org! https://sprocketfox.io/xssfox/2021/12/02/xrandr/)
Okay, here's how to set this up!
You need to create a udev rule for the "second" input device that sets ENV{WL_SEAT} to a string other than "default", and then start Weston from a virtual console. (At least, starting it from another Wayland session didn't work for me.) That's it!
The WL_SEAT property is what Wayland refers to as a "logical seat". Assign the same seat name to a mouse and a keyboard to make them work together! The default seat is "default".
Detailed steps:
1. Use `sudo libinput list-devices` to find the device file (like "/dev/input/event12")
2. Use `udevadm info -a /dev/input/event12` to find the parent device with a catchy ATTRS{name}.
3. Create a file /run/udev/rules.d/00-multiseat.rules like this:
ATTRS{name}="Name of your mouse" ENV{WL_SEAT}="second"
4. Run `sudo udevadm trigger` to apply the new rules.
You can check again with `sudo libinput list-devices`. The device's "Seat" should now say "seat0, second"!
You could try this script (requires zenity & possibly more tools? Please read before running!) https://github.com/n3rdopolis/rebeccablackos/blob/master/rebeccablackos_files/usr/bin/configureseats
(Doesn't work on #NixOS, where /etc/udev is read-only. 💀)
I'd love to have a little command line helper tool to help set this up, for an arbitrary number of mice! :D
This was a fun afternoon! Thanks for following along.
Let me know which other programs I should try with multiple mice! :D
Looks like SDL (the multimedia library) very recently merged support for multi-seat input! https://www.phoronix.com/news/SDL-Merges-Wayland-Multi-Seat
So… many-mouse games should be possible on Wayland? :3
@blinry For NixOS, I think you could do this (just typing this on my phone, I hope it is correct but if not it should be close):
services.udev.packages = [
(lib.writeTextDir "lib/udev/rules.d/00-multiseat.rule" ''
ATTRS{name}="foo bar"
ENVS{WL_SEAT}="second"
'')
];
@blinry I tried to use seats a few years ago, but documentation was shit. I never figured out how to properly configure them. I didn't even find that it was a udev rule thing back then.
Also a lot of people in forums and mailing lists told me that they're not even aware of that feature existing to begin with. (there wasn't a single one that know that this feature exists and also knew how it worked)
So at some point I just gave up on it.
Maybe it's time to check it out again by now.
Physical seats effectively signal "this is a different computer" except it shares some of the same hardware.
Logical seats effectively signal "this is a different person" so they share the environment but work independently within that environment (mouse, keyboard focus, etc).
Except sometimes a logical seat is a different *hand*, not person (because you may want left and right hand to work independently, hence two logical seats) and wheee, off into the rabbit hole we go.
@lanodan @blinry Weston is a bit of a demo of what compositors can do too vs something they expect you to fully use for your desktop.
And rotation would e.g. be useful for a specialized compositor for tabletop applications. (had to fake that many years ago for a floor-scale display, doing an actual compositor would've been fun)
@blinry i want a button that shakes it all up and tumbles the windows ontop of each other like theyve been dumped out of a bucket
i would use this responsibly i promise
@SarraceniaWilds Ha yeah!
Maybe Firefox would be immune? And all note-taking apps are extremely flammable!
I WOULD ALSO ONLY USE THIS RESPONSIBLY I SWEAR
@blinry I'm still waiting for non-rectangle windows. And I mean non-rectangle, not partial transparent rectangle windows. 🤭
These may be ofc tilting as well.
Or give me a 3d desktop, with glasses and everything, so you can out windows behind others and then look from the side... or take a walk along the desktop scebery.
cursed
@blinry its so cursed!
but with a multi input screen flat on a table with people sitting around and working together its not even that far off anymore.
but i guess that needs a lot of other bits refined to be a thing people would even want to use.
@blinry
Da müsste man noch eye tracking machen und könnte dann die Fenster automatisch neigen, wenn man den Kopf schief legt.
Wenn man dann vor seinem Rechner was erklärt und mit dem Kopf schüttelt, .... das wäre voll toll!
@blinry potentially useful for tablets.
What os is that?
Edit: nevermind it was enough to scroll up