Force Wayland when WSL 2 GUI enabled. - #4572
Conversation
There was a problem hiding this comment.
Thanks for the PR; I'm hesitant to merge anything about WSL support without:
- A CI configuration that validates WSL compatibility; and
- Documentation of the state of WSL support.
(I'd also like some external confirmation that it actually works; as noted on #4571, I can't run WSL on my Windows setup locally, so I can't validate this myself).
How can I help providing Windows runners with WSL enabled?
This should be easy part. Could you point me where in documentation you will see this WSL section? |
We're using vanilla GitHub Actions. The runners are provided by GitHub.
A new section at the end of the Windows platform guide would make sense to me. If there's a lot of documentation required, it might make sense to put it on an entirely separate subpage (similar to how GTK/Qt is split into subpages) - but the "Normal Winforms" approach would remain the Windows landing page, with the WSL subpage being referenced at the top of the page as an option. |
| IS_WAYLAND = not isinstance(Gdk.Display.get_default(), GdkX11.X11Display) | ||
| IS_WSL2_GUI_ENABLED = os.getenv("WSL2_GUI_APPS_ENABLED", "0") == "1" | ||
|
|
||
| # Force Wayland on WSL2 if the WSL2 GUI apps feature is enabled |
There was a problem hiding this comment.
The comment should also explain why this is necessary, i.e. what is the problem with X11.
There was a problem hiding this comment.
On a semi related note… noting that IS_WAYLAND is only used on Toga’s side and is not passed to GTK to enable/disable Wayland support. This means that if things do not work without IS_WAYLAND special casing, then we should work out why the usual method we use to detect Wayland does not work…
| ) | ||
|
|
||
| IS_WAYLAND = not isinstance(Gdk.Display.get_default(), GdkX11.X11Display) | ||
| IS_WSL2_GUI_ENABLED = os.getenv("WSL2_GUI_APPS_ENABLED", "0") == "1" |
There was a problem hiding this comment.
Since we wouldn't be able to run at all if GUI apps were disabled, can we rename this to IS_WSL2?
WSL 2 is like a semi-Hyper-V virtualized Linux inside Windows.
From the BeeWare perspective, the only tricky thing that might not work is Toga.
This is because the rendering of the GUI application is handled by WSLg.
It makes it look as if Windows itself is rendering the Linux applications.
To check how Toga deals with rendering the UI through WSLg, I decided to run the Toga GTK3 Testbed under WSL.
Since WSLg supports both Wayland and X11, I forced Wayland because it is the simplest way to get the tests up and running.
refers: #4571
PR Checklist:
Assisted-by: Gemini Flash