You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
keepassxc/xcb.patch

29 lines
954 B

2 years ago
diff -urNr keepassxc-2.7.4-orig/src/main.cpp keepassxc-2.7.4/src/main.cpp
--- keepassxc-2.7.4-orig/src/main.cpp 2022-10-29 21:07:50.000000000 +0200
+++ keepassxc-2.7.4/src/main.cpp 2022-11-01 13:04:08.394545249 +0100
@@ -48,8 +48,24 @@
#include <windows.h>
4 years ago
#endif
+#ifdef Q_OS_LINUX
+void wayland_hacks()
+{
+ QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower();
+ QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower();
+ QByteArray sessionType = qgetenv("XDG_SESSION_TYPE").toLower();
+ if ((sessionType.contains("wayland") && qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) && (currentDesktop.contains("gnome") || sessionDesktop.contains("gnome")))
4 years ago
+ {
+ qputenv("QT_QPA_PLATFORM", "xcb");
+ }
+}
+#endif
+
int main(int argc, char** argv)
{
4 years ago
+#ifdef Q_OS_LINUX
+ wayland_hacks();
4 years ago
+#endif
4 years ago
QT_REQUIRE_VERSION(argc, argv, QT_VERSION_STR)
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)