How to force all chromium apps to use wayland, instead of xwayland by default?
from Presi300@lemmy.world to linux@lemmy.ml on 14 Jun 21:21
https://lemmy.world/post/16532552

I am aware of the switches you can pass to each app to make it use native wayland, but is there any way to do it globally?

#linux

threaded - newest

bjoern_tantau@swg-empire.de on 14 Jun 21:23 next collapse

Do you mean Electron apps? I didn’t even know you could force them to use Wayland.

Vitaly@feddit.uk on 14 Jun 22:49 collapse

Is it bad if they use xwayland?

thayer@lemmy.ca on 14 Jun 23:01 next collapse

Like X11, xwayland is not as secure as a pure Wayland environment but I think it’s important to note that hundreds of thousands of desktop Linux users are likely still running X11.

So, in my opinion, it is not ideal to run xwayland but still completely acceptable for most users who don’t have special security requirements.

Vitaly@feddit.uk on 15 Jun 09:09 collapse

I still run x11 because some of my apps just don’t work on wayland, specifically terminal apps for some reason

bjoern_tantau@swg-empire.de on 14 Jun 23:25 next collapse

Bad is relative. But I have some problems with scaling on a HiDPI display with some Electron apps. I think that might be solved if they were Wayland native.

dinckelman@lemmy.world on 14 Jun 23:52 next collapse

Define bad.

If you can run native in wayland, run in native wayland. Your performance will be better, and if you need scaling, scaling is considerably better too

Presi300@lemmy.world on 15 Jun 06:03 next collapse

They are kinda choppy, when compared to native Wayland apps and screensharing from an app, running in xwayland doesn’t really work…

Asyx@lemmy.ml on 16 Jun 11:43 collapse

If you need fractional scaling, they are unusable blurry. Some screens just need fractional scaling so for those setups it’s almost essential to do this.

You need fractional scaling it your resolution is very high compared to the screen size. So something like a 15 inch 1440p screen would need 150% or 125% scaling because 100% is too small, 200% is too large but with anything in between, xwayland apps are blurry af.

dinckelman@lemmy.world on 14 Jun 21:34 next collapse

Depends on your distribution. Arch packages some electron apps in a way, where they can accept their own flags through a dedicated file. For others, it’s just a plain electron-flags.conf in your ~/.config

I would recommend visiting either the arch wiki, or tour distributions equivalent for details

Keep in mind that this does not apply to CEF apps, as that’s an entirely different framework

boredsquirrel@slrpnk.net on 14 Jun 23:25 next collapse

You mean Electron?

The Arch wiki has docs about that.

For Flatpaks I use the environment variable

ELECTRON_OZONE_PLATFORM_HINT=wayland

See my dotfiles on github.com/boredsquirrel/dotfiles

Same possible for Qt QT_QPA_PLATFORM=wayland

Fisch@discuss.tchncs.de on 15 Jun 10:43 collapse

Is there a noticeable benefit to those apps running natively on Wayland vs running through xWayland?

boredsquirrel@slrpnk.net on 15 Jun 15:49 collapse

I have not checked this, but as far as I know

  • performance: apps are running on a subset of XOrg and xWayland translates it to Wayland
  • RAM: if you have no XWayland apps anymore you save RAM
  • features: some apps may have more features on XOrg, some may have more on Wayland. OBS on XWayland can record keystrokes, QGis on XWayland has not broken dockable toolbars.
SteveTech@programming.dev on 15 Jun 00:51 next collapse

For electron, if ELECTRON_OZONE_PLATFORM_HINT and electron-flags.conf don’t work, you can also add –ozone-platform-hint=wayland to the end of Exec in each .desktop file (also works on Chromium, but not CEF AFAIK and sometimes CEF).

There’s also –ozone-platform-hint=auto if you find yourself switching between X11 and Wayland.

boo_@lemmy.blahaj.zone on 15 Jun 07:20 collapse

Spotify is CEF, I think, and it works pretty well.

hallettj@leminal.space on 16 Jun 00:50 collapse

Probably not directly helpful, but Nix packages for Chromium and Electron apps are set up so that you can switch to native Wayland mode globally by setting an environment variable, NIXOS_OZONE_WL=1

I don’t know of any global setting that isn’t distro-specific.