D5522: Introduce a concept of runtime executables that can be ignored.

Eike Hein noreply at phabricator.kde.org
Thu Apr 20 10:33:06 UTC 2017


hein created this revision.
Restricted Application added a project: Plasma.

REVISION SUMMARY
  This introduces a TryIgnoreRuntimes key in taskmanagerrulesrc's Settings
  group that can be used to list known runtime executables that can be
  ignored when trying to identify the application owning a window by the
  command line of the associated process.
  
  A concrete example is the Frozen Bubble application. Frozen Bubble
  installs a frozen-bubble.desktop with Exec=frozen-bubble, yet its
  WM_CLASS is ("perl", "perl") and its command line is as follows:
  
    /usr/bin/perl /usr/bin/frozen-bubble
  
  The existing servicesFromPid() (now split into servicesFromPid() and
  servicesFromCmdLine()) does not find the frozen-bubble service because
  it works with the leading executable in the command line.
  
  In this patch, TryIgnoreRuntimes is introduced with a default of
  "perl". In the new code, after the initial command line matching pass
  fails, TryIgnoreRuntimes is checked for whether the leading command
  line executable is on the list, and if so, a second command line
  matching pass is run with the remainder of the process' command line,
  now succeeding.
  
  Note that the approach of "try one more thing" rather than checking
  against TryIgnoreRuntimes first is deliberate: The Exec= key in many
  .desktop files contains a complete command line prefixed with the
  runtime executable. In those cases we don't want to ignore the runtime
  executable, or matching would fail.
  
  To complement this, the "perl" WM_CLASS is added to the
  MatchCommandLineFirst rc key. Due to the shoddy metadata Frozen
  Bubble already ended up in servicesFromPid() regardless, but this
  saves some busywork for this WM_CLASS, which can reliably be presumed
  bad.
  
  The patch also fixes a small logic error in the match-command-line-
  without-arguments block, where the result of a KServiceTypeTrader
  query was ignored and immediately overridden by another.

REPOSITORY
  R120 Plasma Workspace

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D5522

AFFECTED FILES
  libtaskmanager/taskmanagerrulesrc
  libtaskmanager/xwindowtasksmodel.cpp

To: hein, #plasma, davidedmundson, broulik
Cc: plasma-devel, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170420/aa9c6736/attachment.html>


More information about the Plasma-devel mailing list