Kaydet (Commit) b4698a22 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

tdf#124292 Qt5 / KDE5 disable Qt's HiDPI scaling

LO does its own layouting and also all the scaling, so disable
the automatic HiDPI scaling explicitly. Otherwise fonts will be
rendered in LoDPI and just scaled as an image, if UI scaling is
enabled in KDE, resulting in really blocky / ugly fonts.

Change-Id: I38503ce27c1671e80d0749d21c6c6dcff1a808a6
Reviewed-on: https://gerrit.libreoffice.org/69941
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 413bfc34
......@@ -643,8 +643,8 @@ void Qt5Graphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
return;
QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen();
rDPIX = pScreen->logicalDotsPerInchX();
rDPIY = pScreen->logicalDotsPerInchY();
rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
}
sal_uInt16 Qt5Graphics::GetBitCount() const { return getFormatBits(m_pQImage->format()); }
......
......@@ -495,6 +495,8 @@ VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance()
unsetenv("SESSION_MANAGER");
}
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
int* pFakeArgc = new int;
*pFakeArgc = nFakeArgc;
pQApplication = new QApplication(*pFakeArgc, pFakeArgv);
......
......@@ -78,8 +78,8 @@ void KDE5SalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
return;
QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen();
rDPIX = pScreen->logicalDotsPerInchX();
rDPIY = pScreen->logicalDotsPerInchY();
rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5;
rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -140,6 +140,8 @@ VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance()
unsetenv("SESSION_MANAGER");
}
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
int* pFakeArgc = new int;
*pFakeArgc = nFakeArgc;
pQApplication = new QApplication(*pFakeArgc, pFakeArgv);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment