From unknown Fri Aug 15 15:33:25 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65785 <65785@debbugs.gnu.org> To: bug#65785 <65785@debbugs.gnu.org> Subject: Status: [PATCH] gnu: kwin: Unwrap executable name for desktop file search. Reply-To: bug#65785 <65785@debbugs.gnu.org> Date: Fri, 15 Aug 2025 22:33:25 +0000 retitle 65785 [PATCH] gnu: kwin: Unwrap executable name for desktop file se= arch. reassign 65785 guix-patches submitter 65785 Zheng Junjie severity 65785 normal tag 65785 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 06 11:44:21 2023 Received: (at submit) by debbugs.gnu.org; 6 Sep 2023 15:44:21 +0000 Received: from localhost ([127.0.0.1]:37173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qduhY-0005Pf-P4 for submit@debbugs.gnu.org; Wed, 06 Sep 2023 11:44:21 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qduhW-0005PP-PY for submit@debbugs.gnu.org; Wed, 06 Sep 2023 11:44:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qduhQ-0005mK-Ba for guix-patches@gnu.org; Wed, 06 Sep 2023 11:44:12 -0400 Received: from smtp81.cstnet.cn ([159.226.251.81] helo=cstnet.cn) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1qduhK-0001nD-8A for guix-patches@gnu.org; Wed, 06 Sep 2023 11:44:10 -0400 Received: from localhost.localdomain (unknown [111.0.51.83]) by APP-03 (Coremail) with SMTP id rQCowADn7qI5nvhk8Bw5Cw--.49771S2; Wed, 06 Sep 2023 23:43:55 +0800 (CST) From: Zheng Junjie To: guix-patches@gnu.org Subject: [PATCH] gnu: kwin: Unwrap executable name for desktop file search. Date: Wed, 6 Sep 2023 23:43:53 +0800 Message-ID: <836a7a424e74184fcd6ab76f77f6c4b6a45c126f.1694015033.git.zhengjunjie@iscas.ac.cn> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: rQCowADn7qI5nvhk8Bw5Cw--.49771S2 X-Coremail-Antispam: 1UD129KBjvJXoWxtFWxArWrurW7Cr1kZr47Jwb_yoW7Zw1rpF 1kCrs0y3yYyr4fJan3Xw12g3W3Z3y8JFyUC39rur18tayDXryjva4fK347AF43Gw1q939r XF4SkrWkGr4rJF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUyIb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8Jw Am72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64vIr41l4I8I 3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxV WUGVWUWwC2zVAF1VAY17CE14v26r1j6r15MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAF wI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcI k0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j 6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUgg_TUUUUU X-Originating-IP: [111.0.51.83] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ Received-SPF: pass client-ip=159.226.251.81; envelope-from=zhengjunjie@iscas.ac.cn; helo=cstnet.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) see https://github.com/NixOS/nixpkgs/pull/116549 * gnu/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/kde-plasma.scm (kwin)[origin]: Use it. --- gnu/local.mk | 1 + gnu/packages/kde-plasma.scm | 1 + ...ecutable-name-for-dot-desktop-search.patch | 89 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 gnu/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6ccd27cba5..f8af4366ef 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1475,6 +1475,7 @@ dist_patch_DATA = \ %D%/packages/patches/kobodeluxe-midicon-segmentation-fault.patch \ %D%/packages/patches/kobodeluxe-graphics-window-signed-char.patch \ %D%/packages/patches/kodi-set-libcurl-ssl-parameters.patch \ + %D%/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch\ %D%/packages/patches/kodi-mesa-eglchromium.patch \ %D%/packages/patches/laby-make-install.patch \ %D%/packages/patches/laby-use-tmpdir-from-runtime.patch \ diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm index 11586a6ce2..331ab28cd1 100644 --- a/gnu/packages/kde-plasma.scm +++ b/gnu/packages/kde-plasma.scm @@ -1210,6 +1210,7 @@ (define-public kwin (method url-fetch) (uri (string-append "mirror://kde/stable/plasma/" version "/" name "-" version ".tar.xz")) + (patches (search-patches "kwin-unwrap-executable-name-for-dot-desktop-search.patch")) (sha256 (base32 "0bssp76lzqqlan5pfg6wjf4z9c6pl6p66ri8p82vqqw406x5bzyb")))) diff --git a/gnu/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch b/gnu/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch new file mode 100644 index 0000000000..8f67553138 --- /dev/null +++ b/gnu/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch @@ -0,0 +1,89 @@ +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,24 @@ ++#ifndef GUIX_UTILS_H ++#define GUIX_UTILS_H ++ ++// kwin ++#include ++ ++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 \ No newline at end of file base-commit: 6113e0529d61df7425f64e30a6bf77f7cfdfe5a5 prerequisite-patch-id: 913694f521724b04504a8a442176f68277104422 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 14 17:31:46 2023 Received: (at 65785-done) by debbugs.gnu.org; 14 Sep 2023 21:31:47 +0000 Received: from localhost ([127.0.0.1]:41343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgtwA-0002Uq-KS for submit@debbugs.gnu.org; Thu, 14 Sep 2023 17:31:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgtw8-0002Ue-Nt for 65785-done@debbugs.gnu.org; Thu, 14 Sep 2023 17:31:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgtvv-0001EZ-2C; Thu, 14 Sep 2023 17:31:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=YOW8c2y5N9hRi37T4TgenP7PKsFm7OMzc66mkYDbQmU=; b=W0JqV2xdx51Oq3m2GJT/ ItSn6jruvs5thKRz1fV+PxDbYga/rT0Lsvdupmk4tvPTYg3v59g6gdDu5gxcirKZqvgHo52p2Qw62 CTnO8oiXGn61DCyv7N+72O7Cb+6t7BqBWLjpvhk6sJWxu3seO0QWI7RhJFc/AoXxXpPTkgO1eQVGR U1jj0KtE4RxBBO8vtFBmu9CTyOlfXcxmtvwWyOHp5+paZRN8zZWoLmUC2wjMgkhlqaYx4lf0AAKYN i4UXF1vrZuEQ7pzesDvARIiI5AV7eYtsLsA1Bi1y/uKaP9u94gGkiFtxqxhNx1UjLXPc3QByOgbZ3 THZNzaSdSb2zOw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Zheng Junjie Subject: Re: bug#65785: [PATCH] gnu: kwin: Unwrap executable name for desktop file search. References: <836a7a424e74184fcd6ab76f77f6c4b6a45c126f.1694015033.git.zhengjunjie@iscas.ac.cn> Date: Thu, 14 Sep 2023 23:31:29 +0200 In-Reply-To: <836a7a424e74184fcd6ab76f77f6c4b6a45c126f.1694015033.git.zhengjunjie@iscas.ac.cn> (Zheng Junjie's message of "Wed, 6 Sep 2023 23:43:53 +0800") Message-ID: <87edj04f2m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65785-done Cc: 65785-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Zheng Junjie skribis: > see https://github.com/NixOS/nixpkgs/pull/116549 > > * gnu/packages/patches/kwin-unwrap-executable-name-for-dot-desktop-search.patch: > New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/kde-plasma.scm (kwin)[origin]: Use it. Applied, thanks! From unknown Fri Aug 15 15:33:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 13 Oct 2023 11:24:16 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator