https://bugs.kde.org/show_bug.cgi?id=522769
Bug ID: 522769
Summary: Service-menu action on a folder-view empty background
intermittently receives no target (empty %f, argc=0)
and no-ops until invoked a second time
Classification: Applications
Product: dolphin
Version First 26.04.3
Reported In:
Platform: Fedora RPMs
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
A Dolphin service menu (Type=Service, MimeType=inode/directory;, with an Exec
containing %f) is exposed on the empty background of a directory view and acts
on the folder shown in that view. The action behaves inconsistently across
otherwise identical invocations: sometimes the %f field code contributes no
target argument and the launched process receives argc=0, and a second
invocation seconds later in the same view launches it with the current folder
path (argc=1). When the invoked program requires that argument, the argc=0
invocation silently no-ops while the next one works. It is most reproducible on
the FIRST background right-click immediately after navigating into a folder.
This is not simply the "nothing selected, so %f is empty" case: the same
background-invoked action, in the same view, demonstrably receives the folder
path on a subsequent invocation (argc=1, /home/mbm/Dotfiles). The target is
therefore available to the action -- the defect is that one invocation receives
no target argument (argc=0) and another, moments later in the same view,
receives the folder path.
Reproduced with two independent, unrelated service menus, so the missing target
is upstream of the invoked command:
(a) Exec=kitty --working-directory %f
(b) a "Download New Service Menus" (KNewStuff) entry: Exec=kitty --directory %f
Both show the identical first-click-nothing / second-click-works behavior.
STEPS TO REPRODUCE
Install a service menu targeting inode/directory with an Exec that points at a
small logger script recording argc/argv, e.g. Exec=/path/logger %f (mark the
.desktop executable so it is authorized).
kbuildsycoca6
Navigate into a folder in Dolphin.
Right-click the empty background -> run the action.
Inspect the logger output.
OBSERVED RESULT
Intermittently the logger receives argc=0 (no target argument), most often on
the first background right-click after entering the folder. A second invocation
logs argc=1 with the correct folder path. Two launches seconds apart in the
same folder (/home/mbm/Dotfiles):
ARGC=0 ARG1='' <- first click: no positional target argument received
ARGC=1 ARG1=/home/mbm/Dotfiles <- second click: folder path received
In the argc=0 line, ARG1='' is the logger printing an unset $1 (no first
positional argument was received); it is not evidence that a zero-length
argument was passed.
EXPECTED RESULT
Identical invocations of the same background action in the same view behave
consistently. Since the action can and does receive the current folder path (as
the second invocation shows), it should not intermittently be launched with no
target argument.
ADDITIONAL NOTES
The action is launched via a systemd --user scope (the process PPID is systemd
--user), whose working directory is the PARENT of the viewed folder. As a side
effect, launchers that fall back to $PWD open one directory up, while launchers
that pass %f straight through simply no-op on the argc=0 click.
Scope of evidence: only %f was captured contributing no target argument
(argc=0). %u/%F/%U were observed equal to %f in the populated state but were
NOT separately captured in the argc=0 state, so no claim is made about them
here.
SOFTWARE/OS VERSIONS
dolphin 26.04.3
kf6-kio-core 6.27.0, kf6-kconfig 6.27.0
Qt 6.x
Fedora 44, Wayland session (niri compositor)ه
--
You are receiving this mail because:
You are watching all bug changes.