Changeset View
Changeset View
Standalone View
Standalone View
krita/main.cc
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | |||||
62 | #include "config_use_qt_tablet_windows.h" | 62 | #include "config_use_qt_tablet_windows.h" | ||
63 | #include <windows.h> | 63 | #include <windows.h> | ||
64 | #ifndef USE_QT_TABLET_WINDOWS | 64 | #ifndef USE_QT_TABLET_WINDOWS | ||
65 | #include <kis_tablet_support_win.h> | 65 | #include <kis_tablet_support_win.h> | ||
66 | #include <kis_tablet_support_win8.h> | 66 | #include <kis_tablet_support_win8.h> | ||
67 | #else | 67 | #else | ||
68 | #include <dialogs/KisDlgCustomTabletResolution.h> | 68 | #include <dialogs/KisDlgCustomTabletResolution.h> | ||
69 | #endif | 69 | #endif | ||
70 | #include "config-high-dpi-scale-factor-rounding-policy.h" | ||||
70 | #include "config-set-has-border-in-full-screen-default.h" | 71 | #include "config-set-has-border-in-full-screen-default.h" | ||
71 | #ifdef HAVE_SET_HAS_BORDER_IN_FULL_SCREEN_DEFAULT | 72 | #ifdef HAVE_SET_HAS_BORDER_IN_FULL_SCREEN_DEFAULT | ||
72 | #include <QtPlatformHeaders/QWindowsWindowFunctions> | 73 | #include <QtPlatformHeaders/QWindowsWindowFunctions> | ||
73 | #endif | 74 | #endif | ||
74 | #include <QLibrary> | 75 | #include <QLibrary> | ||
75 | #endif | 76 | #endif | ||
76 | 77 | | |||
77 | #if defined HAVE_KCRASH | 78 | #if defined HAVE_KCRASH | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 143 | #endif | |||
152 | 153 | | |||
153 | QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); | 154 | QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); | ||
154 | QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); | 155 | QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); | ||
155 | 156 | | |||
156 | #if QT_VERSION >= 0x050900 | 157 | #if QT_VERSION >= 0x050900 | ||
157 | QCoreApplication::setAttribute(Qt::AA_DisableShaderDiskCache, true); | 158 | QCoreApplication::setAttribute(Qt::AA_DisableShaderDiskCache, true); | ||
158 | #endif | 159 | #endif | ||
159 | 160 | | |||
161 | #ifdef HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY | ||||
162 | // This rounding policy depends on a series of patches to Qt related to | ||||
163 | // https://bugreports.qt.io/browse/QTBUG-53022. These patches are applied | ||||
164 | // in ext_qt for WIndows (patches 0031-0036). | ||||
165 | // | ||||
166 | // The rounding policy can be set externally by setting the environment | ||||
167 | // variable `QT_SCALE_FACTOR_ROUNDING_POLICY` to one of the following: | ||||
168 | // Round: Round up for .5 and above. | ||||
169 | // Ceil: Always round up. | ||||
170 | // Floor: Always round down. | ||||
171 | // RoundPreferFloor: Round up for .75 and above. | ||||
172 | // PassThrough: Don't round. | ||||
173 | // | ||||
174 | // The default is set to Round to obtain the same behaviour as in the past, | ||||
175 | // but can be overridden by the above environment variable. | ||||
176 | QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); | ||||
177 | #endif | ||||
178 | | ||||
160 | const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); | 179 | const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); | ||
161 | QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat); | 180 | QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat); | ||
162 | 181 | | |||
163 | bool singleApplication = true; | 182 | bool singleApplication = true; | ||
164 | bool enableOpenGLDebug = false; | 183 | bool enableOpenGLDebug = false; | ||
165 | bool openGLDebugSynchronous = false; | 184 | bool openGLDebugSynchronous = false; | ||
166 | bool logUsage = true; | 185 | bool logUsage = true; | ||
167 | { | 186 | { | ||
▲ Show 20 Lines • Show All 361 Lines • Show Last 20 Lines |