Nothing Special   »   [go: up one dir, main page]

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

xwayland: allow persistence #1961

Merged
merged 1 commit into from
Jul 4, 2024
Merged

Conversation

ahesford
Copy link
Member
@ahesford ahesford commented Jul 3, 2024

This seems to work as expected, keeping the server alive indefinitely at launch rather than allowing it to die.

  • Changing the configuration option and reconfiguring does not change the behavior, because the wlroots xwayland object is still the same as was created at launch. Changing the behavior requires a compositor restart. Do we care? Attempting to fix this would seem to require terminating the X server, which could be catastrophic for any connected clients.
  • Is there a better name or placement for the configuration option?

Closes: #1958.

@Consolatis
Copy link
Member
Consolatis commented Jul 3, 2024
  • Changing the configuration option and reconfiguring does not change the behavior, because the wlroots xwayland object is still the same as was created at launch. Changing the behavior requires a compositor restart. Do we care?

No, I think that limitation is fine. I don't expect users wanting to keep changing this during runtime. We should add that limitation to the man page though (Changing this setting requires a restart of labwc to take effect. or something like that).

@ahesford
Copy link
Member Author
ahesford commented Jul 3, 2024

Updated the docs, and added support for running an xinitrc script whenever Xwayland is started.

@ahesford ahesford changed the title xwayland: allow persistence xwayland: allow persistence, support xinitrc configuration Jul 3, 2024
@Consolatis
Copy link
Member

LGTM, not tested.

Personally, I am fine with having this bypass the release cooldown. Thoughts @johanmalm ?

@ahesford
Copy link
Member Author
ahesford commented Jul 3, 2024

I did some more investigation with the xinitrc addition:

  1. When Xwayland is not running, running xrdb -query locally will print no content (even when I have an .Xresources) the first time. Likewise, running something like gimp when Xwayland is not currently running will cause the application to behave as if no resources were set.
  2. Once Xwayland has launched, running the client (xrdb -query or gimp) will behave as expected, because the xinitrc will have loaded the resource database.
  3. Connecting to a remote host with SSH forwarding when Xwayland is NOT running, and running a client like xrdb -query seems to show the right behavior immediately.

The problem is that we aren't notified that Xwayland is ready until it is already responding to clients, so the local application that triggers its launch has already queried the resource database before we've had a chance to (asynchronously) populate it. The X11 proxy built into SSH seems to delay things long enough that the local xinitrc can populate the database before the remote client accesses it.

This is a race we seem destined to lose for local clients, and I don't believe there is anything that we can do about it. I don't even know if wlroots can do anything about it. I also don't know if my observation of "correct" behavior on remote, SSH-tunneled clients is a necessary consequence of the implementation, or just a race we are less likely to lose.

While there might be some value in supporting xinitrc (and, by reusing the session machinery, it doesn't really cost us anything to do so), I think the only reliable way to solve the configuration issue in #1958 is to configure Xwayland for persistence.

@johanmalm
Copy link
Collaborator
johanmalm commented Jul 3, 2024 via email

@jech
Copy link
Contributor
jech commented Jul 3, 2024

So if making Xwayland persistent is the only way to reliably solve the issue,

I'm sure we can solve the race (which might require changes to wlroots), but I agree that it'd be better to commit just the persistence change now, and delay committing the xinitrc support until we've solved the race.

@ahesford ahesford changed the title xwayland: allow persistence, support xinitrc configuration xwayland: allow persistence Jul 4, 2024
@ahesford
Copy link
Member Author
ahesford commented Jul 4, 2024

I moved "persists" to "persistence" in the first commit, and decided to move the xinitrc support to #1963 for separate consideration. As described in that PR, I believe there is still merit in supporting an xinitrc script.

@Consolatis Consolatis merged commit 9153c22 into labwc:master Jul 4, 2024
5 checks passed
@Consolatis
Copy link
Member

Thanks!

@ahesford ahesford deleted the quick-brown-fox branch July 4, 2024 15:37
@jech
Copy link
Contributor
jech commented Jul 13, 2024

I've just moved to 0.7.3, and this solves my issue quite nicely. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

X11 resources set by xrdb don't survive xwayland restart
4 participants