qt5ct: fix missing app icon and name when running under Wayland

Patch has been upstreamed (https://sourceforge.net/p/qt5ct/code/549/)
and will be removed in the future.
This commit is contained in:
Chris Rendle-Short 2019-08-27 21:28:56 +10:00 committed by Matthieu Coudron
parent 4d11f5dabd
commit 75214a9c8b
2 changed files with 27 additions and 0 deletions

View file

@ -15,6 +15,11 @@ mkDerivation rec {
buildInputs = [ qtbase ];
# Wayland needs to know the desktop file name in order to show the app name and icon.
# Patch has been upstreamed and can be removed in the future.
# See: https://sourceforge.net/p/qt5ct/code/549/
patches = [ ./wayland.patch ];
qmakeFlags = [
"LRELEASE_EXECUTABLE=${getDev qttools}/bin/lrelease"
];

View file

@ -0,0 +1,22 @@
--- a/src/qt5ct/main.cpp
+++ b/src/qt5ct/main.cpp
@@ -29,14 +29,18 @@
#include <QApplication>
#include <QLibraryInfo>
#include <QLocale>
-#include "qt5ct.h"
+#include <QtGlobal>
#include <QTranslator>
#include <QtDebug>
+#include "qt5ct.h"
#include "mainwindow.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
+ QGuiApplication::setDesktopFileName("qt5ct.desktop");
+#endif
QTranslator translator;
QString locale = Qt5CT::systemLanguageID();
translator.load(QString(":/qt5ct_") + locale);