Use Wayland backend for Wayland sessions

These two flags tell Electron, through Chromium, to use Wayland for rendering. The flags are set in the bash script, because setting them in desktop/main.js causes issues with rendering.

Rendering with Wayland instead of X11 and XWayland gives better support for DPI scaling. Additionally, this change also has implications for drag-and-drop, since drag-and-drop does not work consistently from XWayland to Wayland apps and visa versa (for example, from XWayland KeeWeb to Wayland Firefox under sway).
This commit is contained in:
Grant Moyer 2021-12-28 18:55:23 -05:00
parent e674607fce
commit 3b635966ab
1 changed files with 5 additions and 1 deletions

View File

@ -1,2 +1,6 @@
#!/bin/bash
/usr/share/keeweb-desktop/keeweb "$@"
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
/usr/share/keeweb-desktop/keeweb --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"
else
/usr/share/keeweb-desktop/keeweb "$@"
fi