From 1bfcca91be17cd7207e83c08bb8466f9e17d3aea Mon Sep 17 00:00:00 2001 From: ctrlaltca Date: Thu, 28 Jan 2021 21:21:11 +0100 Subject: [PATCH] add window icons in wayland (#4232) Co-authored-by: Fabio Bas --- cockatrice/src/main.cpp | 4 ++++ oracle/src/main.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 89abee12..69003a3d 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -151,6 +151,10 @@ int main(int argc, char *argv[]) qDebug("main(): MainWindow constructor finished"); ui.setWindowIcon(QPixmap("theme:cockatrice")); +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + // set name of the app desktop file; used by wayland to load the window icon + QGuiApplication::setDesktopFileName("cockatrice"); +#endif SettingsCache::instance().setClientID(generateClientID()); diff --git a/oracle/src/main.cpp b/oracle/src/main.cpp index b26c339d..6cae0b6d 100644 --- a/oracle/src/main.cpp +++ b/oracle/src/main.cpp @@ -62,6 +62,10 @@ int main(int argc, char *argv[]) QIcon icon("theme:appicon.svg"); wizard.setWindowIcon(icon); +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + // set name of the app desktop file; used by wayland to load the window icon + QGuiApplication::setDesktopFileName("oracle"); +#endif wizard.show();