diff options
author | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2023-05-15 12:30:26 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-05-31 06:33:19 +0000 |
commit | b5a8a7c6518872f99eeb52f0d7ab71a7843ef830 (patch) | |
tree | b5db9aa23f844397189502158667184cd68ea62e | |
parent | 59342ce2c57a0e3f3670f4d26a8a046d59753f8c (diff) |
Client: Don't sanitize desktop file name
This doesn't work well if the app id ends with ".desktop".
Change-Id: I33d7c92f87595251f0da90277d12b2a2bb286a30
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d39442d1fc944d03da71bdd53986da77ad71c8da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/client/qwaylandwindow.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index abab795c6..776cb99d5 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -141,19 +141,15 @@ void QWaylandWindow::initWindow() setWindowTitle(window()->title()); // The appId is the desktop entry identifier that should follow the - // reverse DNS convention (see http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html). - // According to xdg-shell the appId is only the name, without - // the .desktop suffix. + // reverse DNS convention (see + // http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html). According + // to xdg-shell the appId is only the name, without the .desktop suffix. // - // If the application specifies the desktop file name use that - // removing the ".desktop" suffix, otherwise fall back to the - // executable name and prepend the reversed organization domain - // when available. + // If the application specifies the desktop file name use that, + // otherwise fall back to the executable name and prepend the + // reversed organization domain when available. if (!QGuiApplication::desktopFileName().isEmpty()) { - QString name = QGuiApplication::desktopFileName(); - if (name.endsWith(QLatin1String(".desktop"))) - name.chop(8); - mShellSurface->setAppId(name); + mShellSurface->setAppId(QGuiApplication::desktopFileName()); } else { QFileInfo fi = QFileInfo(QCoreApplication::instance()->applicationFilePath()); QStringList domainName = |