Windows: Change default to ProcessPerMonitorV2DpiAware
Fixes: QTBUG-68712 Change-Id: Id73c4a5422e50b5bee2160468feb4d2f09c5461a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
7a1be5ee1e
commit
d66cb667ef
@ -245,9 +245,11 @@ void QWindowsIntegrationPrivate::parseOptions(QWindowsIntegration *q, const QStr
|
|||||||
initOpenGlBlacklistResources();
|
initOpenGlBlacklistResources();
|
||||||
|
|
||||||
static bool dpiAwarenessSet = false;
|
static bool dpiAwarenessSet = false;
|
||||||
// Default to per-monitor awareness to avoid being scaled when monitors with different DPI
|
static bool hasDpiAwarenessContext = QWindowsContext::user32dll.setProcessDpiAwarenessContext != nullptr;
|
||||||
// are connected to Windows 8.1
|
// Default to per-monitor-v2 awareness (if available)
|
||||||
QtWindows::ProcessDpiAwareness dpiAwareness = QtWindows::ProcessPerMonitorDpiAware;
|
QtWindows::ProcessDpiAwareness dpiAwareness = hasDpiAwarenessContext ?
|
||||||
|
QtWindows::ProcessPerMonitorV2DpiAware : QtWindows::ProcessPerMonitorDpiAware;
|
||||||
|
|
||||||
int tabletAbsoluteRange = -1;
|
int tabletAbsoluteRange = -1;
|
||||||
DarkModeHandling darkModeHandling;
|
DarkModeHandling darkModeHandling;
|
||||||
m_options = ::parseOptions(paramList, &tabletAbsoluteRange, &dpiAwareness, &darkModeHandling);
|
m_options = ::parseOptions(paramList, &tabletAbsoluteRange, &dpiAwareness, &darkModeHandling);
|
||||||
@ -265,7 +267,6 @@ void QWindowsIntegrationPrivate::parseOptions(QWindowsIntegration *q, const QStr
|
|||||||
if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) {
|
if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) {
|
||||||
|
|
||||||
// DpiAwareV2 requires using new API
|
// DpiAwareV2 requires using new API
|
||||||
bool hasDpiAwarenessContext = QWindowsContext::user32dll.setProcessDpiAwarenessContext != nullptr;
|
|
||||||
if (dpiAwareness == QtWindows::ProcessPerMonitorV2DpiAware && hasDpiAwarenessContext) {
|
if (dpiAwareness == QtWindows::ProcessPerMonitorV2DpiAware && hasDpiAwarenessContext) {
|
||||||
m_context.setProcessDpiV2Awareness();
|
m_context.setProcessDpiV2Awareness();
|
||||||
qCDebug(lcQpaWindows)
|
qCDebug(lcQpaWindows)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user