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

config: add option to enable/disable xwayland #7633

Merged
merged 9 commits into from
Sep 5, 2024

Conversation

Trimutex
Copy link
Contributor

@Trimutex Trimutex commented Sep 3, 2024

Describe your PR, what does it fix/add?

Allows enabling and disabling XWayland during runtime. #3371 appears to be stale and not being worked on.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

  1. Disables "DISPLAY" env variable to prevent X11 launches. Due to this, a pop up will occur notifying of this. Is this to be left alone or is there a better way of informing the user that XWayland is not enabled?
  2. While it closes the windows, applications like Steam are still running in the background with a tray icon. Is it possible to close these or just ignore them?

Is it ready for merging, or does it need work?

Current state of commit works, but see above for things I would like to address first. Closes #7607

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this work at runtime? e.g. if someone enables it while running hl

@vaxerski
Copy link
Member

vaxerski commented Sep 3, 2024

if yes it'd be nice to also do xwaylanf restore while we at it (restart if crash)

@Trimutex
Copy link
Contributor Author

Trimutex commented Sep 3, 2024

will this work at runtime? e.g. if someone enables it while running hl

Yeah, the option is meant to work while Hyprland is running and I want to keep it that way

if yes it'd be nice to also do xwaylanf restore while we at it (restart if crash)

calling g_pXWayland->reset(), or resetting is members (pServer, pWM) crashes it when disabling due to lingering apps, probably due to the same issue as 2 above

@Trimutex
Copy link
Contributor Author

Trimutex commented Sep 3, 2024

Unless there is some way to simply test if it crashed that I'm unaware of? That would just be oversight from my part if there's a good way for that

@vaxerski
Copy link
Member

vaxerski commented Sep 3, 2024

I think if the wm is yeeten off then it crashed or died

@Trimutex
Copy link
Contributor Author

Trimutex commented Sep 4, 2024

Update note: This PR currently only prevents creation of new XWayland windows by unsetting the env variable. I'll continue to dig deeper on actually shutting down XWayland and applications with it off.

@Trimutex
Copy link
Contributor Author

Trimutex commented Sep 4, 2024

Few bugs but currently handles turning off/on multiple times just fine

Current Bugs

  • Steam stays alive after closing its windows and can only exit if XWayland is re-enabled (not sure if fixable)
  • Possibly taking another window with it when disabling (seems to be if previous window was X11?)

@Trimutex
Copy link
Contributor Author

Trimutex commented Sep 4, 2024

@vaxerski Should be all good now for merge.

Leaving steam issue alone as I don't think its an XWayland problem, just would require keeping track of PIDs and killing them. That might be leaking into territory better made for another PR.

Additional mention as you asked about it that XWayland should fully restore on re-enable. I can't test that for sure though as I don't have a reliable way of crashing it in such a way that it can't restart.

src/xwayland/XWM.cpp Outdated Show resolved Hide resolved
@Trimutex
Copy link
Contributor Author

Trimutex commented Sep 5, 2024

Managed to crash XWayland and can confirm this restores successfully!

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sankyu!

@vaxerski vaxerski merged commit bd6d6e7 into hyprwm:main Sep 5, 2024
10 checks passed
@Trimutex Trimutex deleted the xwayland-config branch September 26, 2024 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable XWayland on runtime
2 participants