Fix global scale reset with custom platformthemes

At least Kvantum makes QGuiApplication constructor to call QGuiApplication::devicePixelRatio, so the value is cached and won't change.

Resetting the cache fixes the issue.
This commit is contained in:
Ilya Fedin 2021-12-16 04:54:49 +04:00 committed by RadRussianRus
parent c6b55d9c37
commit 05c0f7aa47

View file

@ -13,6 +13,8 @@
#include <QtGui/QWindow>
#include <QtGui/QtEvents>
#include <QWheelEvent>
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
#include <array>
@ -214,6 +216,7 @@ bool IsContentVisible(
void DisableCustomScaling() {
QHighDpiScaling::setGlobalFactor(1);
QGuiApplicationPrivate::resetCachedDevicePixelRatio();
}
int WheelDirection(not_null<QWheelEvent*> e) {