mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-01-09 12:48:01 +00:00
fix XDG desktop check
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "src/utils/dbusutils.h"
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMessage>
|
||||
#include <desktopinfo.h>
|
||||
#endif
|
||||
|
||||
int waitAfterConnecting(int delay, QCoreApplication& app)
|
||||
@@ -41,11 +42,8 @@ int waitAfterConnecting(int delay, QCoreApplication& app)
|
||||
void wayland_hacks()
|
||||
{
|
||||
// Workaround to https://github.com/ksnip/ksnip/issues/416
|
||||
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") && (currentDesktop.contains("gnome") ||
|
||||
sessionDesktop.contains("gnome"))) {
|
||||
DesktopInfo info;
|
||||
if (info.windowManager() == DesktopInfo::GNOME) {
|
||||
qputenv("QT_QPA_PLATFORM", "xcb");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user