ublue-os / bluefin

The next generation Linux workstation, designed for reliability, performance, and sustainability.
https://projectbluefin.io
Apache License 2.0
1.06k stars 144 forks source link

Wayland for VSCode #1362

Closed juliansko closed 3 months ago

juliansko commented 3 months ago

Describe the bug

Hi, as we all know, Wayland, Fractional Scaling and XWayland aren't exactly friends. Luckily modern electron apps provide a flag that can enable native Wayland support. I'd like to request to enable that native wayland support by default for the preinstalled VSCode in bluefin-dx.

Since bluefin provides images made for specific Laptops (in my case the Framework Laptop) I think it would make sense to enable Wayland for every application there. Of course it is not a huge task to fix, especially if you have a bit experience but I think it is an inconvenience for new users, therefore it would make sense in my opinion to enable wayland support (or rather just append the ozone flag to the .desktop file)

What did you expect to happen?

I expected VSCode to use Wayland by default, but it uses XWayland which is a bad out-of-the-box experience for users that use fractional scaling.

Output of rpm-ostree status

No response

Output of groups

No response

Extra information or context

No response

lehmanju commented 3 months ago

This can be easily achieved by setting following environment variable: ELECTRON_OZONE_PLATFORM_HINT=auto

m2Giles commented 3 months ago

If you are not using code from the cmdline, it is simple to drop this in either /usr/local/share/applications or ~/.local/share/applications as an override for code.desktop.

If you need use code from the command line. Setup an alias with ozone flags set.

[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code --enable-features=UseOzonePlatform --ozone-platform-hint=auto --unity-launch %F
Icon=vscode
Type=Application
StartupNotify=false
StartupWMClass=code-url-handler
Categories=TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Name[de]=Neues leeres Fenster
Name[es]=Nueva ventana vacía
Name[fr]=Nouvelle fenêtre vide
Name[it]=Nuova finestra vuota
Name[ja]=新しい空のウィンドウ
Name[ko]=새 빈 창
Name[ru]=Новое пустое окно
Name[zh_CN]=新建空窗口
Name[zh_TW]=開新空視窗
Exec=/usr/share/code/code --enable-features=UseOzonePlatform --ozone-platform-hint=auto --new-window %F
Icon=vscode

This will also not double up the icons.