Support for correctly identifying flatpaks, specifally the Steam Flatpak

Christian Kellner requested to merge gicmo/gnome-usage:steam_flatpak into master

Currently the steam flatpak is bunched in with system, because the command line in the desktop file does not match any of the processes in the steam flatpak. This is of course especially true for any games started in the Steam Flatpak. This merge request does a few things:

  • Maintains a stable map of of pidProcess (stable means, same Process objects for the system processes)
  • On update only add new Process or delete removed objects from aforementioned map
  • Maintain a map of AppInfo.get_id()AppInfo
  • Add a Process.app_id property, that will look inside the roof of the process and use .flatpak-info's name, if available
  • If we cannot find an AppInfo via the command line, try to use Process.app_id

All this will result in all processes of the same Flatpak (currently also all instances) to be bunched together in one AppItem and additionally that Flatpak will correctly be identified via the Process.app_id, i.e. the [Application] name of the .flatpak-info.

I tested it for Steam and it works ok.


Builds upon MR !62 (closed) Closes #66 (closed)

Merge request reports