Permalink
Browse files

Add a config option to enable high-DPI scaling (#701)

The new EnableHiDPI boolean option permits to enable or not the
activation of Qt::AA_EnableHighDpiScaling attribute.

The default is enabled.

[ChangeLog][Greeter] Enable Qt's automatic high dpi scaling based on
configuration

Signed-off-by: Stany MARCEL <stanypub@gmail.com>
  • Loading branch information...
1 parent 4728fb4 commit 3441112487e477e146f1ffd532725edcd285eba6 @ynsta ynsta committed with plfiorini Sep 15, 2016
Showing with 7 additions and 1 deletion.
  1. +1 −0 src/common/Configuration.h
  2. +6 −1 src/greeter/GreeterApp.cpp
@@ -42,6 +42,7 @@ namespace SDDM {
Entry(Numlock, NumState, NUM_NONE, _S("Initial NumLock state. Can be on, off or none.\n"
"If property is set to none, numlock won't be changed\n"
"NOTE: Currently ignored if autologin is enabled."));
+ Entry(EnableHiDPI, bool, true, _S("Enable Qt's automatic high-DPI scaling"));
Entry(InputMethod, QString, QString(), _S("Input method module"));
// Name Entries (but it's a regular class again)
Section(Theme,
@@ -242,7 +242,12 @@ int main(int argc, char **argv) {
qInstallMessageHandler(SDDM::GreeterMessageHandler);
// HiDPI
- QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ if (SDDM::mainConfig.EnableHiDPI.get()) {
+ qDebug() << "High-DPI autoscaling Enabled";
+ QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ } else {
+ qDebug() << "High-DPI autoscaling Not Enabled";
+ }
QStringList arguments;

0 comments on commit 3441112

Please sign in to comment.