From 3b635966ab7cd472baa20e878ae242b6266434a1 Mon Sep 17 00:00:00 2001 From: Grant Moyer Date: Tue, 28 Dec 2021 18:55:23 -0500 Subject: [PATCH] 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). --- package/deb/usr/bin/keeweb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/deb/usr/bin/keeweb b/package/deb/usr/bin/keeweb index 3e692e4c..f2347212 100755 --- a/package/deb/usr/bin/keeweb +++ b/package/deb/usr/bin/keeweb @@ -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