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

On-demand/socket activation #102

Open
YaLTeR opened this issue Feb 1, 2025 · 0 comments
Open

On-demand/socket activation #102

YaLTeR opened this issue Feb 1, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@YaLTeR
Copy link

YaLTeR commented Feb 1, 2025

Compositors like Mutter do a thing where they create and listen to a DISPLAY socket on their own, then only when a client connects, they spawn Xwayland on-demand and pass it the client fd. I'd like to do the same in niri, but with xwayland-satellite.

The advantages are:

  1. niri locks/creates the socket, so it can export the right DISPLAY variable automatically.
  2. If xwayland-satellite dies, the socket remains open on niri side, it can just spawn a new instance right away if a new client connects.
  3. This also allows xwayland-satellite to exit when all X11 clients disconnect to conserve resources.

I'm not sure how exactly this works. Here's the relevant Mutter code: https://gitlab.gnome.org/GNOME/mutter/-/blob/fc6d79eda9395fe1151049b1b0a23974911bc1d7/src/wayland/meta-xwayland.c#L850-886 Seems like it spawns Xwayland with a few fds open, then tells it about them in commandline args. I guess this needs to be exposed in Smithay's Xwayland wrapper.

@Supreeeme Supreeeme added the enhancement New feature or request label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants