From 6f9c0750091d3bbe642c712a09f13a0acfdf57a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= Date: Fri, 8 Feb 2019 23:41:24 -0500 Subject: [PATCH] Fix Linux HiDPI handling Fix HiDPI order of operations, remove shortcut technique --- cmake/linux/lmms.desktop | 2 +- src/core/main.cpp | 4 +++- src/gui/GuiApplication.cpp | 5 ----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmake/linux/lmms.desktop b/cmake/linux/lmms.desktop index 67e9c2f1146..4f8000d29a8 100644 --- a/cmake/linux/lmms.desktop +++ b/cmake/linux/lmms.desktop @@ -8,7 +8,7 @@ Comment=Music sequencer and synthesizer Comment[ca]=Producció fàcil de música per a tothom! Comment[fr]=Production facile de musique pour tout le monde ! Icon=lmms -Exec=env QT_X11_NO_NATIVE_MENUBAR=1 QT_AUTO_SCREEN_SCALE_FACTOR=1 lmms %f +Exec=env QT_X11_NO_NATIVE_MENUBAR=1 lmms %f Terminal=false Type=Application Categories=Qt;AudioVideo;Audio;Midi; diff --git a/src/core/main.cpp b/src/core/main.cpp index 45f2bb66be0..a71461799a6 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -252,7 +252,9 @@ int main( int argc, char * * argv ) return EXIT_FAILURE; } #endif - +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif QCoreApplication * app = coreOnly ? new QCoreApplication( argc, argv ) : new MainApplication( argc, argv ); diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 2c577868c8c..c33fbf0a2fe 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -54,11 +54,6 @@ GuiApplication* GuiApplication::instance() GuiApplication::GuiApplication() { - // enable HiDPI scaling before showing anything (Qt 5.6+ only) - #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); - #endif - // prompt the user to create the LMMS working directory (e.g. ~/Documents/lmms) if it doesn't exist if ( !ConfigManager::inst()->hasWorkingDir() && QMessageBox::question( NULL,