Summary:
When no match can be made from classClass, attempt a fallback where we
match any DesktopEntryName that contains classClass and drop all that
do not end with '.$classClass' (i.e. ones that certainly are not using
reverse-domain-name notation. classClass is usually the appname, but
without RDN.
So, when a RDN using application cannot be matched directly (i.e. its
classClass is different from its binary name) we'd end up with an
unsuccessful mapping and use the binary-path as launcherUrl. To improve
on this when that case occurs we now attempt to loosely find a single
matching RDN desktop file and prefer that over the binary fallback match.
Illustrative example:
- org.kde.dragonplayer.desktop
- binary is 'dragon'
- qapp appname and thus classClass is 'dragonplayer'
- classClass cannot directly match the desktop file because of RDN
- classClass also cannot match the binary because of name mismatch
- now *.classClass can match org.kde.dragonplayer though
Reviewers: hein
Reviewed By: hein
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1447
This is a follow-up to fbd4a876, which introduced an option to
have running tasks always use the same icon that would be used
for a launcher item. The Task Manager applets subsequently were
updated to default this option to on, addressing frequent user
complaints that Task Manager launchers don't respect their
theming choices (due to window icons overriding the icon theme,
or custom configured icons) or that the icon changes when a
launcher item is replaced by a running task item.
However, for windows that can't be mapped back to an application
known to the menu system, this meant falling back to the MIME
type of the executable, making applications that aren't properly
installed usually end up with application-x-executable or some-
thing else.
This commit changes behavior so that if the launcher URL pro-
duced for a window isn't a valid KService storage id, the window
icon is used again. In turn, since the behavior is now no longer
a trivial yes or no, the option has been dropped from the
library again, making the menu-icon-takes-precedence approach
always-on. In turn, if a launcher item is generated while a
window is around, the icon is taken from the window and stored
persistently. If a launcher is added programmatically using an
URL that can't be mapped to the menu, the icon will be updated
from the window icon at runtime.
BUG:351624
CCMAIL:jkt@kde.org
With the option disabled, task items use the window icon whenever
possible. With the option enabled, the launcher icon is used
instead. This prevents a jarring icon change when applications use
a different icon theme from Plasma Desktop, at the cost of losing
realtime window icon updates being reflected in the Task Manager.
Defaults to on. The Task Manager applets are getting a checkbox
for it.
This is a rock-and-a-hard-place decision. Users are regularly
upset about what they perceive as their theming choice not being
respected, and pleading for app fixes appears to be fairly fruit-
less. It also looks like Wayland will nix runtime window icon
changes. Nonetheless this will likely produce complaints about
edge cases (e.g. Gimp miniature window previews).
CCMAIL:348050
Cf. ffdeb08a in kde-workspace.git (unfortunately plasma-workspace.git
lost libtaskmanager history) for reference.
CCMAIL:mgraesslin@kde.org
CCMAIL:bhush94@gmail.com
CCMAIL:ivan.cukic@kde.org
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
techbase wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://community.kde.org/Frameworks/GitOldHistory
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo kde-workspace, frameworks branch, at commit
049113e719dd2fc4446d054fa1a3aada330094f0