You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#117 fixed the most glaring issue here, and 8a4d4b6 make sure it at least doesn't block the UI thread, but it's inefficient to iterate over all desktop files for each opened app. I believe desktop_info_for_app_ids was copied from another Cosmic component (perhaps freedesktop-desktop-entry could provide better helpers here, once a better solution is in place).
If we just want to find a desktop file for an app id, we can only open one desktop file (in the first search directory we find it in), but the StartupWMClass comparison requires iterating over all desktop files. Is that needed? Only for XWayland clients? (What does Gnome do, etc?) Maybe it could only try that if it doesn't find an app with that id? I assume even if it's needed, it's okay for that to take lower precedence vs file name app ids...
It could also cache if there are multiple windows with the same app ID. Or cache icon names for all apps, but it should re-check if applications is changed, at least for newly installed apps.
The text was updated successfully, but these errors were encountered:
ids1024
changed the title
Optimize icon_for_app_id to avoid
Optimize icon_for_app_id to avoid reading all desktop files for each new toplevel
Jan 21, 2025
#117 fixed the most glaring issue here, and 8a4d4b6 make sure it at least doesn't block the UI thread, but it's inefficient to iterate over all desktop files for each opened app. I believe
desktop_info_for_app_ids
was copied from another Cosmic component (perhapsfreedesktop-desktop-entry
could provide better helpers here, once a better solution is in place).If we just want to find a desktop file for an app id, we can only open one desktop file (in the first search directory we find it in), but the
StartupWMClass
comparison requires iterating over all desktop files. Is that needed? Only for XWayland clients? (What does Gnome do, etc?) Maybe it could only try that if it doesn't find an app with that id? I assume even if it's needed, it's okay for that to take lower precedence vs file name app ids...It could also cache if there are multiple windows with the same app ID. Or cache icon names for all apps, but it should re-check if
applications
is changed, at least for newly installed apps.The text was updated successfully, but these errors were encountered: