Autodetect a Wayland environment and configure SDL correctly. Fixes #211

This commit is contained in:
Cameron Gutman 2019-04-21 18:31:11 -07:00
commit 9c5d847dae
4 changed files with 26 additions and 8 deletions

View file

@ -1,11 +1,14 @@
#include "systemproperties.h"
#include <QGuiApplication>
#include "streaming/session.h"
#include "streaming/streamutils.h"
SystemProperties::SystemProperties()
{
isRunningWayland = qgetenv("XDG_SESSION_TYPE") == "wayland";
isRunningXWayland = qgetenv("XDG_SESSION_TYPE") == "wayland" && QGuiApplication::platformName() == "xcb";
#ifdef Q_OS_WIN32
isWow64 = QSysInfo::currentCpuArchitecture() != QSysInfo::buildCpuArchitecture();

View file

@ -12,6 +12,7 @@ public:
Q_PROPERTY(bool hasHardwareAcceleration MEMBER hasHardwareAcceleration CONSTANT)
Q_PROPERTY(bool isRunningWayland MEMBER isRunningWayland CONSTANT)
Q_PROPERTY(bool isRunningXWayland MEMBER isRunningXWayland CONSTANT)
Q_PROPERTY(bool isWow64 MEMBER isWow64 CONSTANT)
Q_PROPERTY(bool hasBrowser MEMBER hasBrowser CONSTANT)
Q_PROPERTY(QString unmappedGamepads MEMBER unmappedGamepads NOTIFY unmappedGamepadsChanged)
@ -28,6 +29,7 @@ private:
bool hasHardwareAcceleration;
bool isRunningWayland;
bool isRunningXWayland;
bool isWow64;
bool hasBrowser;
QString unmappedGamepads;