diff --git a/src/app/main.cpp b/src/app/main.cpp index 4d2e28e65..26b87f3cc 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -103,6 +103,12 @@ int main(int argc, char *argv[]) QApplication::setOrganizationDomain(AppSupport::getAppDomain()); QApplication::setApplicationVersion(AppSupport::getAppVersion()); +#ifdef Q_OS_LINUX + if (AppSupport::isWayland()) { + QGuiApplication::setDesktopFileName(AppSupport::getAppID()); + } +#endif + #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); @@ -123,8 +129,10 @@ int main(int argc, char *argv[]) #endif // init splash - // don't show on wayland (broken) - const bool showSplash = QGuiApplication::platformName() != "wayland"; + bool showSplash = true; +#ifdef Q_OS_LINUX + showSplash = !AppSupport::isWayland(); +#endif QSplashScreen splash(QPixmap(":/icons/splash/splash-00001.png")); if (showSplash) { splash.show(); diff --git a/src/core/appsupport.cpp b/src/core/appsupport.cpp index ac48b504b..417a08603 100644 --- a/src/core/appsupport.cpp +++ b/src/core/appsupport.cpp @@ -691,6 +691,11 @@ bool AppSupport::isAppImage() return !getAppImagePath().simplified().isEmpty(); } +bool AppSupport::isWayland() +{ + return QGuiApplication::platformName().startsWith("wayland"); +} + const QString AppSupport::getAppImagePath() { return QString(qgetenv("APPIMAGE")); @@ -876,6 +881,9 @@ bool AppSupport::setupXDGDesktopIntegration() } } + if (isWayland()) { + QGuiApplication::setDesktopFileName(getAppID()); + } return true; } diff --git a/src/core/appsupport.h b/src/core/appsupport.h index 45e7c3f5c..51a63c164 100644 --- a/src/core/appsupport.h +++ b/src/core/appsupport.h @@ -119,6 +119,7 @@ class CORE_EXPORT AppSupport : public QObject static const QPair hasWriteAccess(); static bool isAppPortable(); static bool isAppImage(); + static bool isWayland(); static const QString getAppImagePath(); static bool hasXDGDesktopIntegration(); static bool setupXDGDesktopIntegration();