Skip to content

Commit

Permalink
wayland stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Dec 29, 2024
1 parent c2c805f commit 059bff5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions src/core/appsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -876,6 +881,9 @@ bool AppSupport::setupXDGDesktopIntegration()
}
}

if (isWayland()) {
QGuiApplication::setDesktopFileName(getAppID());
}
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/core/appsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class CORE_EXPORT AppSupport : public QObject
static const QPair<QStringList,bool> hasWriteAccess();
static bool isAppPortable();
static bool isAppImage();
static bool isWayland();
static const QString getAppImagePath();
static bool hasXDGDesktopIntegration();
static bool setupXDGDesktopIntegration();
Expand Down

0 comments on commit 059bff5

Please sign in to comment.