Mailspring icon indicating copy to clipboard operation
Mailspring copied to clipboard

snap: Run as native wayland client if possible

Open 3v1n0 opened this issue 1 year ago • 9 comments

The new electron versions support wayland natively, this implies that mailspring can use the native rendering when in a wayland desktop environment, bringing various benefits including a better rendering in high DPI displays.

To enable this electron still requires some flags, so add a wrapper launcher that is used to enable them unless wayland isn't explicitly disabled.

3v1n0 avatar Nov 24 '23 00:11 3v1n0

FWIW, I wasn't even able to open Mailspring using the flatpak on Hyprland without XWayland until I used the flags (--enable-features=WaylandWindowDecorations --ozone-platform=wayland --use-gl=desktop) here.

jpeeler avatar Dec 06 '23 21:12 jpeeler

Hey @3v1n0 thanks for all your contributions around this -- do you know what if any additional testing should be done here? I've found this Snap stuff to be fairly finicky and my only hesitation around this is that we might break one of the two paths taken by this new wrapper (wayland/non-wayland) in the future without noticing.

bengotow avatar Dec 10 '23 17:12 bengotow

Hey @3v1n0 thanks for all your contributions around this -- do you know what if any additional testing should be done here? I've found this Snap stuff to be fairly finicky and my only hesitation around this is that we might break one of the two paths taken by this new wrapper (wayland/non-wayland) in the future without noticing.

So, the testing to do is try to run this in both wayland and X11, but in my tests there are no issues.

I've been testing this mostly on 22.04 and 23.10, but I may also give 20.04 a shot if you want.

The wrapper is needed to check what backend to use, since wayland is not default in electron yet. But I had no issues so far.

Also, together with this we may need to add a documentation line mentioning that snap set mailspring wayland-native=false can be used to turn this off and just use the very same behavior of other versions.

3v1n0 avatar Dec 11 '23 13:12 3v1n0

@bengotow any news here?

If you prefer to be conservative, we could make the wayland option to be manually set. This could be also controlled by the UI making the wrap read a figuration file, but IMHO it's an option that can stay at host level.

3v1n0 avatar Jan 10 '24 13:01 3v1n0

Thanks for working on this!

IMHO a conservative way is still far better than workarounds we have to use. I wasn't even able to pass these flags to a snap version at all (permission issue I believe), so I had to install a deb package.

Once a flag is available to use we all could give it a try and provide some feedback if this can be safely enabled by default.

BohdanTkachenko avatar Jan 11 '24 23:01 BohdanTkachenko

Ok, I've changed the launcher logic so that by default the client will continue using xwayland backend, unless sudo snap set mailspring wayland-native=true is used.

3v1n0 avatar Jan 12 '24 18:01 3v1n0

ping? :smile:

3v1n0 avatar Apr 18 '24 21:04 3v1n0

Requested GL implementation (gl=desktop-gl,angle=none) not found in allowed implementations: [(gl=egl-gles2,angle=none),(gl=egl-angle,angle=swiftshader)] when trying --use-gl=desktop outside snap

edisionnano avatar May 21 '24 21:05 edisionnano

@edisionnano what you mean, is that if you launch the current snap with such arg?

A part you may need more (--enable-features=WaylandWindowDecorations --ozone-platform=wayland --use-gl=desktop), but also the current snap launcher defines DISABLE_WAYLAND that implies changes in the desktop launcher that won't make it work

3v1n0 avatar May 21 '24 21:05 3v1n0