mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-16 17:50:45 -04:00
fix(gamescope): DPI Attributes
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -84,6 +84,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QGuiApplication>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
@@ -6221,17 +6222,16 @@ int main(int argc, char* argv[]) {
|
|||||||
!qgetenv("STEAM_DECK").isEmpty();
|
!qgetenv("STEAM_DECK").isEmpty();
|
||||||
|
|
||||||
if (is_gamescope) {
|
if (is_gamescope) {
|
||||||
// Force the environment to ignore the Deck's high-density screen
|
// 1. Force the scale factor to exactly 1.0
|
||||||
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0");
|
|
||||||
qputenv("QT_ENABLE_HIGHDPI_SCALING", "0");
|
|
||||||
qputenv("QT_SCALE_FACTOR", "1");
|
qputenv("QT_SCALE_FACTOR", "1");
|
||||||
|
qputenv("QT_SCREEN_SCALE_FACTORS", "1");
|
||||||
|
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0");
|
||||||
qputenv("QT_FONT_DPI", "96");
|
qputenv("QT_FONT_DPI", "96");
|
||||||
|
|
||||||
// Force Qt to use a 1:1 pixel ratio
|
// 2. This must be called BEFORE the QApplication object is created
|
||||||
// These MUST be set before the QApplication app(...) line
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
|
||||||
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_Use96Dpi);
|
|
||||||
|
|
||||||
|
// 3. Ensure windowing system plays nice with Gamescope
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
|
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs);
|
QCoreApplication::setAttribute(Qt::AA_DontUseNativeDialogs);
|
||||||
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "xdg-shell");
|
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "xdg-shell");
|
||||||
|
|||||||
Reference in New Issue
Block a user