-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
VS Code should default to Wayland when possible #207033
Comments
Should be noted: |
In terms of steps needed to address this improvement, I think the most direct approach would be for VS Code to default to Ozone on Linux? Users should be able to just run |
that would be highly appreciated, the warning is quite annoying
|
Yes please, I hate the current state. There is no way to ask vscode to run with wayland by default, I have tried all of the X-flags.conf I have found online without success. Without wayland, the scaling is awful. |
For those who use gnome shell, there is a method to update the application shortcut for code in a way that doesn't get overwritten by updates. Since implementing this behavior as default would still allow for x11 fallback support when needed I think it is a fantastic idea to make this the default behavior. |
|
You may also create the following file on distros using systemd (or in # ~/.config/environment.d/30-electron-ozone-wayland.conf
ELECTRON_OZONE_PLATFORM_HINT=auto Though for me running under wayland breaks shortcuts like Ctrl+Shift+´ (which I assume is the same issue as #127932) so that should be fixed before defaulting to wayland as I assume many people using non-US layouts will be affected by this. |
Thank you @septatrix . Setting the environment variable
|
Thank you @septatrix . Setting the environment variable
For changes to |
I tried everything listed here, but vscode still starts under XWayland for me. Any idea what's going on? |
That works on Ubuntu 22.04, as well, thanks! Unfortunately, it also moved the close, minimize and maximize buttons to the other side of the window bar (from right to left). Is there a way to reverse this? |
Just installed insiders on ubuntu, same issue, 4K monitor, 150% scaling (also had to fix chrome with |
Just from personal experience, for something that you use as frequently as your code editor that runs various things on your system for dev, I prefer the actual binary (i.e. code distributed through the deb repo). |
That's what I ended up doing, uninstall snap, install from repo, set env, only downside as others mentioned is the min/max/close buttons are now reversed to the OS. It is a pita to have to fix wayland scaling for chrome and vscode and warp, each in a different way, for the same issue. |
wait so what happened to the window decoration (the thing around the actual application window with the buttons? Are you on ubuntu desktop (since you mentioned Snaps)? To be fair, fractional scaling on Wayland is a (basically) solved problem in Electron. But it's really something that's a problem with app devs and because desktop Linux users still make up such a small fraction in general. Also Gnome on wayland only has client-side decorations so that's another part app devs have to handle (although I don't think it's right) |
When setting the env variable code changes its location of window control buttons (decorations?) to the other side compared to normal apps, this is on ubuntu desktop 24.04. |
I reread everything you wrote a few times but it isn't entirely clear what you did and what happened. But the screenshot in the issue you referenced seems to show a standard GTK decoration. The blurriness from rendering through xwayland out of the box should be fixed as a priority though. Wondering if there's a timeline for this? |
|
Hello, for some reason my VS Code is always using XWayland instead of native Wayland. I believe it is after some nvidia driver update/other update.
in |
Have you confirmed the flags are actually fed into vs code on startup? I'm assuming you're on Arch with the conf path |
I'm on Fedora 40. You are right, I've tested manually passing flags to the although I see this log:
What I did is I modified the desktop file and created an alias in my
It really works, but does not seem totally ideal to me. |
No need for command line options just set the env var discussed above |
Tried it, doesn't work...
|
Also, I should note that I'm using Ubuntu 24.04 LTS as well, which uses GNOME 46 as the DE. |
I've also created a separate issue regarding VS Code no longer supporting Native Wayland, as seen here: #231955 |
Even though I get those warnings, it still applies them correctly for me. Open xeyes and run your cursor over the vscode window and see if the eyes move. |
Please re-read what I said above:
That means it doesn't open at all. No window, nothing. Even the |
It didn't open for me with the flags mentioned above @PlatinumLucario try the above |
I have the same problem as @PlatinumLucario. VSC on fresh ubuntu 24.04 dosent open at all. '--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland' dosent work |
does it work with no flags? if not, then its due to something else. |
Sure it works with no flags. Simply put and as already stated above, the Snap package doesn't work with Wayland at least on Ubuntu and with these options |
I thought everyone having this problem were on ubuntu. |
It's not just the Snap package that won't open in Native Wayland, I can confirm by trying that all of them won't open in Native Wayland. Yep, this means even the .tar.gz portable package, and the apt installations or any installation via any package manager won't make any difference. It only runs in XWayland, it refuses to boot in Native Wayland. |
Same here. None of the |
For me (Fedora 41 / Gnome 47 / vscode 1.95.2) the true test is also whether vscode survives |
On Gnome, I'm getting a weird flickery/flashy white border on the top, when the window is maximized with Wayland. With XWayland, this glitchy artifact goes away. Anyone experiencing this? |
I've also noticed that this not only affects VS Code, but all apps built in Electron. So this is an Electron issue, meaning it's completely broken in all Electron apps. |
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
Please see the comment above and vote it up if you support it! @Flimm @hermidalc @ctilley83 @deepak1556 @PlatinumLucario @justin13888 @ryanabx @RafalSkolasinski @real-felix @SethMacKayChandler @MartyBeGood @zortax @musjj @zubozrout @Waakul @christian80gabi @RichardFevrier @mikeslade @shreyasminocha |
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
For some reason if I open code with terminal(kitty) it uses env variable which makes it work with Wayland. But if I launch it with Rofi (rofi-wayland exactly), it uses xwayland. The only thing driving me nuts is keyring issues, I have to reenter my token any time it's launching with xwayland. I guess rofi is issue but I can't be sure with that |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Run
code
from terminal or open VS Code using code.desktop packaged with VS Code for Fedora repositories.Problem:
It appears VS Code always defaults to XWayland on running on Linux Wayland desktops (at least when I tried on Fedora Workstation 39 and Ubuntu 22.04 LTS). Wayland has been the default display server on most GNU/Linux distros for the past few years, even for NVIDIA drivers. While forcing VS Code to start with Wayland with command-line arguments for example is possible, it is an extra step and the most convenient method to always start VS Code with Wayland is to append
--enable-features=UseOzonePlatform --ozone-platform=wayland
to your .desktop files or aliascode
with those arguments.However, updating VS Code for example on Fedora may overwrite any changes to the .desktop file. There should be a way for VS Code to default to Wayland without manual user invention when Wayland is detected. Open to thoughts and comments on this suggestion and its feasibility!
Note: There may be similar issues or duplicate but I cannot find them
The text was updated successfully, but these errors were encountered: