Files
moonlight-qt/app/utils.h
T
Cameron Gutman d79536b56d Only accept usable bounds if they differ from the full bounds
Some platforms (Wayland) just report the full display area, so we
incorrectly assume the entire display is usable for a window.

Fixes #2056
2026-10-22 20:53:30 -05:00

28 lines
666 B
C++

#pragma once
#include <QString>
#define THROW_BAD_ALLOC_IF_NULL(x) \
if ((x) == nullptr) throw std::bad_alloc()
namespace WMUtils {
bool isRunningX11();
bool isRunningNvidiaProprietaryDriverX11();
bool supportsDesktopGLWithEGL();
bool isRunningWayland();
bool isRunningWindowManager();
bool isRunningDesktopEnvironment();
bool hasDisplayUsableBounds();
QString getDrmCardOverride();
bool isGpuSlow();
}
namespace Utils {
template <typename T>
bool getEnvironmentVariableOverride(const char* name, T* value) {
bool ok;
*value = (T)qEnvironmentVariableIntValue(name, &ok);
return ok;
}
}