vscode: Vscode does not launch in wayland session
- VS Code Version: 1.66
- OS Version: Fedora 36
Steps to Reproduce:
- When I launch vscode with
code --enable-features=UseOzonePlatform --ozone-platform=waylandit does not run under wayland it does under xwayland
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 39
- Comments: 26 (1 by maintainers)
I’m experiencing the same issue on Arch Linux, but I’ve found a weird workaround - if you run code with many command line options it will reliably launch in Wayland-native mode:
code --enable-features=UseOzonePlatform --ozone-platform=wayland --log debug --log debugI’ve gotten it to work on several machines, though each requires a different amount of--log debugoptions (one needs two, another needs five).Tested on: Arch Linux, Ryzen 5 5600G, Radeon Graphics, Wayland, Sway - x2
--log debugArch Linux, Intel Core i7-1165G7, Iris Xe Graphics, Wayland, Sway - x5--log debugArch Linux, Intel Core m3-6Y30, Intel HD Graphics 515, Wayland, Sway - x2--log debugI guess not before Wayland backend becomes default when running in a wayland compositor. Right now it’s opt-in, so users who enable it should know what they are doing and what the risks are.
The following works for me on Arch (4x
--log debug):I don’t understand the reasoning, this does not have anything to do with testing a feature in CI
For people stuck on 1.65 because of Wayland-related issues, you can also use VS Code Insiders which is less stable (as you’d expect from nightly releases) but it works well for me under Wayland. Mine reports Electron 17.4.0.
Howdie, thanks for sharing this very cool project
I was wondering if there were plans to include a wayland test case in CI at some point? Is there a milestone or a set of other tasks that need to be done before doing so?
Put another way, when will wayland regressions block releases?
Cheers!
Ah, cool. Thanks for sharing. Yeah, it looks like the fix was included Electron 17.3.1. So I guess we just have to wait for that.
Still failing for me with 1.66.1
Same thing, exactly this input (or more args) launches VSCode with native Wayland window
Without any arguments or with just
--ozone-platform-hint=waylandit starts xwayland window. Arch Linux / KDE Plasma (wayland session)Doesn’t work on Arch, including
--disable-gpu-sandboxAs a side note, this affects all electron applications with version 17 I’ve tried, including the little test app that pops up when you run just
electron(this probably affects earlier versions of Electron as well) but not with electron-nightly, hopefully thanks to the PR mentioned by Xelphos.For example: on the left, using the latest available version of Electron (from Manjaro repositories), on the right using
electron-nightlyfrom NPM.I guess we have to wait for a backport of whatever fixed the issue into 17.x, then wait for VS Code to update the bundled version of Electron?
@Xelphos hu, cool feature flag, helps me with another application.
For VSCode I’m using an internal setting quite a while now:
"window.titleBarStyle": "custom"And I’ll keep using the VSCode custom title bar, because with the electron flag I get a normal looking title bar, but the buttons are on the left instead of the right and going to fullscreen keeps a quite large padding around the whole window.
With the custom title bar it looks much better in my opinion.
You need to use
--enable-features=WaylandWindowDecorationsOr change the Title Bar Style to custom in settings.
Merging to https://github.com/microsoft/vscode/issues/141964, this is a known issue and will be fixed with next electron patch update.