Closed ryonakano closed 2 years ago
Yeah it would be better if we can get the app info other than from desktop files as a fallback.
GNOME seems to handling this thing well; The label of the menubar says "VirtualBox Machine" in the same situation:
We can leave providing a fallback to another PR. Thanks!
Merge #225 first!
It seems like
power_eater.application.get_desktop_file ()
can returnnull
if the desktop file is unavailable. For me, this happens when running several virtual machines on VirtualBox. And in this case (when the desktop file is unavailable), the power eater section in the Power Indicator only shows the header and blank rows:This PR fixes this strange behavior. If the desktop file is unavailable and can't show any apps, simply hide the header itself too, by counting the actual number of the AppRows, instead of the number of the power eaters (which could include apps whose desktop file is available).