-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Native wayland support with newest electron #109176
Comments
Thanks for opening the issue, agree with the benefits. The electron PR only got the basic compilation bits, there will be follow-up PRs to make it feature complete. VSCode will consume those binaries once they are available. Upstream issue: electron/electron#10915 |
Ozone has now landed in stable chrome (87) and in electron 11.0.1! I tried to compile vscode in electron-11.x.x branch, targeting electron 11.0.1. It compiles fine, but if I launch code as follows: EDIT: if I run it through gdb it now segfaults. [Thread 1 "code-oss" received signal SIGSEGV, Segmentation fault. |
There's also a Wayland debug flag ( |
Thanks, this is the output given: |
As far as I'm aware the official builds for Electron 11 do not have Wayland support. The initial Wayland support (electron/electron#26022) will only land in Electron 12. So unless you're using an unofficial Electron build which has backported the Wayland fixes (e.g.: electron-ozone from the AUR) I think it's expected for the build to crash. |
electron-11 compile from my Gentoo Linux overlay works without any issue ( And works with musl libc! ) |
Uhm, @12101111 are you launching vscode with |
Good to know, thank you so much!
And thank you for the info! |
Yes |
Now that the exploration builds should support wayland, is there any place to download them? I can only find insider builds but if I'm understanding correctly those aren't on electron 12 yet? |
If you're using RPM based systems, you can find the exploration builds here: https://packages.microsoft.com/yumrepos/vscode/ I guess that even the today's exploration build is still on 11.0.3. I managed to patch vscode to build an electron 12.0.0-beta.4 version and it kinda works (menubar doesn't). EDIT: my patch is this one. Use it at your own risk |
I'm getting a weird crash when running
VSCode crashes when I move the cursor into the window, and the terminal it's launched from displays this as soon as I do:
Here is a video of this happening: https://www.youtube.com/watch?v=7JOz1q59qGc The text in the window is crisp, which is not the case on XWayland applications on hi-DPI displays on sway, so it does actually appear to be launching in Wayland! I'd be more than happy to help by providing additional info :) |
@andrewnicolalde as far as I understand, the latest code-exploration build is still on 11.0.3, thus it doesn't have the Ozone code path properly enabled. |
Any idea when we can see VS Code with Electron 12 and the partial Wayland support? |
@theGeekyLad Wait at least until Electron 12 itself is released. It's in beta right now. |
According to this document, Electron 12 will be released the 2nd of March 2021 😢. |
Really looking forward to this! |
While we're all waiting for native wayland support, a bit of a workaround: Run code-server and use it from Firefox, which has native wayland support. Ideally run it in an SSB (firefox's equivalent of chrome's PWAs) to avoid keybinding conflicts. That'll require enabling If you don't require access to the marketplace or proprietary extensions, this should suffice until the Electron 12 builds are ready. |
For someone who is using archlinux and wayland. I created an aur package called "visual-studio-code-wayland", which basically builds vscode with electron 12. it is inspired by the patch from @kriive above. please see here: https://aur.archlinux.org/packages/visual-studio-code-wayland. |
I should definitely switch to Arch one day all the best packages are there 😂 |
Oh you are trying to use What happens if you add the followings: --enable-features=UseOzonePlatform
--ozone-platform=wayland to That worked for me but I had to use |
vscode/resources/linux/bin/code.sh Line 53 in 037fd05
|
I added the flags to ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@" --enable-features=UseOzonePlatform --ozone-platform=wayland The output was the same (flags not recognized) and the program failed to start. If I try to run the binary directly, it still fails, but now it says: segmentation fault. $ /opt/visual-studio-code-insiders/code-insiders --ozone-platform=wayland
[14304:0315/122951.408013:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is egl, ANGLE is
[14304:0315/122951.411317:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
[0315/122951.464512:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0315/122951.483451:ERROR:directory_reader_posix.cc(42)] opendir /home/thblckjkr/.config/Code - Insiders/Crashpad/attachments/1afec696-1873-45a6-aedc-cda4c093efb9: No such file or directory (2)
Segmentation fault (core dumped) I also added the flags on the |
I just ran:
And confirmed that although I get this warning.
Another way to find out if the program you are running is Try that on your One interesting thing I found out is that while you do not need Footnotes
|
I am using (Gnome) Manjaro. The version in the official repository is Code OSS. That thing did not start if I pass those flags. The version in in AUR, Also, it seems to be using Electron 13. I have manually installed the latest Electron, whose version seems to be 17, and it looks crisp text. I want to try "ELECTRON_RUN_AS_NODE=1 electron /usr/lib/code/out/cli.js /usr/lib/code/code.js ...." but there are no such files. I only see "/opt/visual-studio-code", and it has "cli.js", but no "code.js". It has "code", but its size is 130MB, so it probably is not a JS file. |
Hmm... I wonder how you called it because it works for me on sway.
According to this document on Gnome you might need additional feature to enable window decorations on wayland:
BTW, unless you change the default keybindings for Gnome, you should be able to move the window by holding +<mouse_button> (I am not sure which mouse button) |
Adding on the cli works for me on Ubuntu 21.10 with sway, in ~/.config/electron-flags.conf and ~/.config/electron13-flags.conf doesn't. XDG_CONFIG_HOME isn't set by sway, not sure if that makes a difference. |
Alternatively you can use the custom title bar. Works well for me on Pop!_OS and also saves some vertical space. |
VSCode 1.66 just hit stable for Arch, and after upgrading to 1.66 I can no longer run VSCode as a native wayland application. There must be a regression issue. Previously I code run:
And it would run as a native wayland application. When I try to do this with 1.66, the application fails to start. I can still run it just fine as an XWayland application. Note: you can run |
Since Chromium 97, enabling the Wayland backend only requires the (this has nothing to do with the comment above) |
I've tried that, and it didn't seem to work (even before the hard crash now with VSCode 1.66). I'm not sure if it's because VSCode is still using an older version of electron? You're correct that it does work for Google Chrome. In fact I do have the following in my
It it works fine for Chrome. Edit: continued... |
I wanted to provide a coredump of the crash that is occurring with VSCode 1.66 when attempting to run it as a native wayland application. I'm not sure if this will help or not. Based on this thread it seemed that there was a regression introduced with 1.66 (which people using |
I'm also hitting this as of 1.66. Seems like it's probably the same issue as being discussed here? #146349 |
I don't know if has already been said, but also Chrome updated yesterday on Arch - Version 100.0.4896.60 (Official Build) (64-bit) - is broken with Wayland now. |
Electron17 is now updated to 17.3.1. Now I am able to launch |
|
FWIW the Insiders version runs, but starts as LoDPI on a display which has 200% scaling. Using Same is with latest signal-desktop, but for Signal I know of no way to reload it the window... |
This comment was marked as resolved.
This comment was marked as resolved.
Actually on Arch
$ pacman -Q code
code 1.66.0-2
$ cat ~/.config/electron17-flags.conf
--enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer
--ozone-platform=wayland
--ozone-platform-hint=auto
|
Well i don't know what went wrong before, but now for me it also works... Sorry for the spam |
None of those config files work for me on Ubuntu 22.04 with code 1.66.2. Launching code with --verbose spews so much output it doesn't help me see the problem. |
If you mean the |
Yes, this an the version specific electron17-flags.conf. |
I got the same issue as @slagiewka with a 150% scaling. The same issue happens when you relaunch Chrome while keeping active tabs. |
On Fedora 36 + Sway, One way to work around this is to copy the Once Code is already running from an app launcher, the I don't think this issue is really fixed until VS Code is natively using Wayland by default if it's available. |
The flag |
Native wayland support would be great to run vs code without XWayland as described in #77752.
Recently electron merged the chrome version with the ozone backend needed:
electron/electron#26022
This would allow for:
The text was updated successfully, but these errors were encountered: