summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-03-29 02:58:59 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2019-03-30 00:51:02 +0100
commitb4698a2241ec26d796c66da3a814f7cc693785b6 (patch)
treee17c8d913825e50f64770366058fa7479dc0ef08
parent413bfc34423b950fa5a9f9a6edc2f3d36b1e638b (diff)
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: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--vcl/qt5/Qt5Graphics_GDI.cxx4
-rw-r--r--vcl/qt5/Qt5Instance.cxx2
-rw-r--r--vcl/unx/kde5/KDE5SalGraphics.cxx4
-rw-r--r--vcl/unx/kde5/KDE5SalInstance.cxx2
4 files changed, 8 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index e38a10d4fb90..d5186f0d583b 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -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()); }
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 429b69f90b79..f0d42666e3ce 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -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);
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 290127d0526e..0b4b4283f0da 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -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: */
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index 6bca4d88a90c..d746d53beace 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -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);