summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-04-11 14:05:59 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-04-14 14:35:38 +0200
commitdbdc0475097210ec88f1e867b4464fdcd17a5d37 (patch)
tree4106d1a4fa3011c3c46a9911b12e33c346e17fde /vcl
parentec1e3977cad824da6017fe150d55c262cd68dccd (diff)
Qt add additional info to ToolkitName
Adds the used font backend and the QPA platform name, so we don't need to ask / verify all time (and less chance of wrong info). Examples: - qt5 (qfont+xcb) => QFont text rendering + X11 backend - kf5 (cairo+wayland) => Cairo text rendering + Wayland backend Change-Id: I1102dd6d83b0ed48318ac5c31c8ca09d4fdd73eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113945 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/qt5/Qt5Instance.hxx2
-rw-r--r--vcl/qt5/Qt5Instance.cxx16
-rw-r--r--vcl/unx/kf5/KF5SalInstance.cxx2
3 files changed, 15 insertions, 5 deletions
diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index 5dc2db898d29..111e86f0878a 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -84,6 +84,8 @@ protected:
createPicker(css::uno::Reference<css::uno::XComponentContext> const& context,
QFileDialog::FileMode);
bool useCairo() const { return m_bUseCairo; }
+ // encodes cairo usage and Qt platform name into the ToolkitName
+ OUString constructToolkitID(std::u16string_view sTKname);
public:
explicit Qt5Instance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo = false);
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 5afbd8722418..3ea129b8aeea 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -196,6 +196,17 @@ void Qt5Instance::RunInMainThread(std::function<void()> func)
}
}
+OUString Qt5Instance::constructToolkitID(std::u16string_view sTKname)
+{
+ OUString sID(sTKname + OUStringLiteral(u" ("));
+ if (m_bUseCairo)
+ sID += OUStringLiteral(u"cairo+");
+ else
+ sID += OUStringLiteral(u"qfont+");
+ sID += toOUString(QGuiApplication::platformName()) + OUStringLiteral(u")");
+ return sID;
+}
+
Qt5Instance::Qt5Instance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo)
: SalGenericInstance(std::make_unique<Qt5YieldMutex>())
, m_bUseCairo(bUseCairo)
@@ -206,10 +217,7 @@ Qt5Instance::Qt5Instance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo)
, m_bUpdateFonts(false)
{
ImplSVData* pSVData = ImplGetSVData();
- if (bUseCairo)
- pSVData->maAppData.mxToolkitName = OUString("qt5+cairo");
- else
- pSVData->maAppData.mxToolkitName = OUString("qt5");
+ pSVData->maAppData.mxToolkitName = constructToolkitID(u"qt5");
// this one needs to be blocking, so that the handling in main thread
// is processed before the thread emitting the signal continues
diff --git a/vcl/unx/kf5/KF5SalInstance.cxx b/vcl/unx/kf5/KF5SalInstance.cxx
index 1335d4123a2e..608b5dccc4dc 100644
--- a/vcl/unx/kf5/KF5SalInstance.cxx
+++ b/vcl/unx/kf5/KF5SalInstance.cxx
@@ -37,7 +37,7 @@ KF5SalInstance::KF5SalInstance(std::unique_ptr<QApplication>& pQApp, bool bUseCa
: Qt5Instance(pQApp, bUseCairo)
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maAppData.mxToolkitName = OUString("kf5");
+ pSVData->maAppData.mxToolkitName = constructToolkitID(u"kf5");
}
SalFrame* KF5SalInstance::CreateChildFrame(SystemParentData* /*pParent*/, SalFrameStyleFlags nStyle)