diff options
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 14 | ||||
-rw-r--r-- | vcl/qt5/QtInstance.cxx | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index 24dcb5ff6f..6aff814aac 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -376,6 +376,20 @@ void QtFrame::SetIcon(sal_uInt16 nIcon) QIcon aIcon = QIcon::fromTheme(appicon); m_pQWidget->window()->setWindowIcon(aIcon); + + if (QGuiApplication::platformName() == "wayland" && m_pQWidget->window()->isVisible()) + { + // Qt currently doesn't provide API to directly set the app_id for a single + // window/toplevel on Wayland, but the one set for the application is picked up + // on hide/show, so do that. + // An alternative would be to use private Qt API and low-level wayland API to set the + // app_id directly, s. discussion in QTBUG-77182. + const QString sOrigDesktopFileName = QGuiApplication::desktopFileName(); + QGuiApplication::setDesktopFileName(appicon); + m_pQWidget->window()->hide(); + m_pQWidget->window()->show(); + QGuiApplication::setDesktopFileName(sOrigDesktopFileName); + } } void QtFrame::SetMenu(SalMenu*) {} diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx index 4880c1bdec..f87cdef934 100644 --- a/vcl/qt5/QtInstance.cxx +++ b/vcl/qt5/QtInstance.cxx @@ -708,6 +708,11 @@ std::unique_ptr<QApplication> QtInstance::CreateQApplication(int& nArgc, char** // for scaled icons in the native menus QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif + // force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 default + // policy and prevents incorrect rendering with the Qt 6 default policy + // Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915) + QGuiApplication::setHighDpiScaleFactorRoundingPolicy( + Qt::HighDpiScaleFactorRoundingPolicy::Round); FreeableCStr session_manager; if (getenv("SESSION_MANAGER") != nullptr) |