summary refs log tree commit diff
path: root/pkgs/tools/misc/qt5ct
diff options
context:
space:
mode:
authorChris Rendle-Short <chris@killred.net>2019-08-27 21:28:56 +1000
committerMatthieu Coudron <coudron@iij.ad.jp>2019-08-28 20:05:39 +0900
commit75214a9c8b1def725560a8a5999695a11c0727f4 (patch)
tree7a131dfbe82a323c48c01547382c5297d93171aa /pkgs/tools/misc/qt5ct
parent4d11f5dabda5098e66a59fa1bd909befd39d841f (diff)
downloadnixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.tar
nixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.tar.gz
nixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.tar.bz2
nixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.tar.lz
nixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.tar.xz
nixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.tar.zst
nixpkgs-75214a9c8b1def725560a8a5999695a11c0727f4.zip
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.
Diffstat (limited to 'pkgs/tools/misc/qt5ct')
-rw-r--r--pkgs/tools/misc/qt5ct/default.nix5
-rw-r--r--pkgs/tools/misc/qt5ct/wayland.patch22
2 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/tools/misc/qt5ct/default.nix b/pkgs/tools/misc/qt5ct/default.nix
index 9069821fe35..fbb56b98be7 100644
--- a/pkgs/tools/misc/qt5ct/default.nix
+++ b/pkgs/tools/misc/qt5ct/default.nix
@@ -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"
   ];
diff --git a/pkgs/tools/misc/qt5ct/wayland.patch b/pkgs/tools/misc/qt5ct/wayland.patch
new file mode 100644
index 00000000000..fe186cfa469
--- /dev/null
+++ b/pkgs/tools/misc/qt5ct/wayland.patch
@@ -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);
\ No newline at end of file