diff options
Diffstat (limited to 'vcl/qt5/QtFrame.cxx')
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 14 |
1 files changed, 14 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*) {} |