origin patch from nixos. see https://github.com/NixOS/nixpkgs/blob/2457551a54ffbd93b7d8f84af8b8fb3aac5cbdd5/pkgs/desktops/plasma-5/kwin/0001-NixOS-Unwrap-executable-name-for-.desktop-search.patch --- src/guix_utils.h | 41 +++++++++++++++++++++++++++++++++++++++++ src/service_utils.h | 4 +++- src/waylandwindow.cpp | 5 ++++- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/guix_utils.h diff a/src/guix_utils.h b/src/guix_utils.h new file mode 100644 index 0000000..726065d --- /dev/null +++ b/src/guix_utils.h @@ -0,0 +1,23 @@ +#ifndef GUIX_UTILS_H +#define GUIX_UTILS_H + +// kwin + +namespace KWin +{ + +static QString unwrapExecutablePath(const QString &in_executablePath) +{ + QString executablePath(in_executablePath); + + while (executablePath.endsWith("-real") && executablePath[executablePath.lastIndexOf("/")+1] == QChar('.')) { + executablePath.remove(executablePath.length() - 5, 5); + executablePath.remove(executablePath.lastIndexOf("/")+1, 1); + } + + return executablePath; +} + +}// namespace + +#endif // GUIX_UTILS_H diff a/src/utils/serviceutils.h b/src/utils/serviceutils.h index 8a70c1f..475b15d 100644 --- a/src/utils/serviceutils.h +++ b/src/utils/serviceutils.h @@ -19,6 +19,7 @@ #include //KF #include +#include "guix_utils.h" namespace KWin { @@ -26,8 +27,9 @@ namespace KWin const static QString s_waylandInterfaceName = QStringLiteral("X-KDE-Wayland-Interfaces"); const static QString s_dbusRestrictedInterfaceName = QStringLiteral("X-KDE-DBUS-Restricted-Interfaces"); -static QStringList fetchProcessServiceField(const QString &executablePath, const QString &fieldName) +static QStringList fetchProcessServiceField(const QString &in_executablePath, const QString &fieldName) { + const QString executablePath = unwrapExecutablePath(in_executablePath); // needed to be able to use the logging category in a header static function static QLoggingCategory KWIN_UTILS ("KWIN_UTILS", QtWarningMsg); const auto servicesFound = KApplicationTrader::query([&executablePath] (const KService::Ptr &service) { diff a/src/waylandwindow.cpp b/src/waylandwindow.cpp index fd2c0c1..ae8cf96 100644 --- a/src/waylandwindow.cpp +++ b/src/waylandwindow.cpp @@ -10,6 +10,7 @@ #include "screens.h" #include "wayland_server.h" #include "workspace.h" +#include "guix_utils.h" #include #include @@ -173,7 +174,9 @@ void WaylandWindow::updateIcon() void WaylandWindow::updateResourceName() { - const QFileInfo fileInfo(surface()->client()->executablePath()); + const QString in_path = surface()->client()->executablePath(); + const QString path = unwrapExecutablePath(in_path); + const QFileInfo fileInfo(path); if (fileInfo.exists()) { const QByteArray executableFileName = fileInfo.fileName().toUtf8(); setResourceClass(executableFileName, executableFileName); -- 2.32.0 MATCH-RECORD indentation....* .dir-locals.el: Treat the fourth form onwards as the body, rather than the third onwards. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> (unmatched-parenthesis d 2023-03-17Revert gexp->derivation and computed-file indentation rules....This reverts b1c25e2ce364741d1c257d3bb3ab773032807a80 and partially reverts 82daab42811a2e3c7684ebdf12af75ff0fa67b99, which means the computed-file and gexp->derivation procedures are now indented as normal procedures. Rationale: see the discussion at https://lists.gnu.org/archive/html/guix-devel/2023-03/msg00008.html. In a nutshell: the convention is to use special rules for special forms (macros), not for procedures. * .dir-locals.el (scheme-mode): Remove the special indentation rules for the computed-file and gexp->derivation procedures. Maxim Cournoyer 2023-03-05.dir-locals.el: Allow Guix root-dir overrides when working via Tramp....* .dir-localsl.el: Add only the local part of the root directory to the guile search path. This lets you use Tramp to hack on a remote Guix checkout. Signed-off-by: Leo Famulari <leo@famulari.name> Brian Cully 2023-02-19.dir-locals: Add let-keywords indentation rules....* .dir-locals.el (scheme-mode): Add let-keywords indentation rules. Maxim Cournoyer 2023-02-02.dir-locals.el: Adjust indentation rule for test-assertm....* .dir-locals.el: Adjust the scheme-indent-function property for test-assertm, so that the two first arguments (the test name and the store variable) are indented as procedure arguments. Maxim Cournoyer 2023-02-02.dir-locals.el: Add indentation rule for computed-file....* .dir-locals.el: Configure scheme-indent-function property for computed-file, so that its first argument (the file name) is indented as a procedure argument. Maxim Cournoyer 2022-09-07.dir-locals.el: Update yas snippets directory....* .dir-locals.el (eval): Update yas snippets directory. Andrew Tropin 2022-09-05.dir-locals.el: Add .go to completion-ignored-extensions....* .dir-locals.el (eval): Add .go to completion-ignored-extensions. Andrew Tropin 2022-09-05.dir-locals.el: Add guix yasnippets....* .dir-locals.el (eval): Add guix yasnippets. Andrew Tropin