lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
72 stars 35 forks source link

Workaround for random lack of icons in newly installed apps #283

Closed tsujan closed 2 years ago

tsujan commented 2 years ago

Workaround for random lack of icons in newly installed apps

This patch is a workaround for a random problem whose cause should be outside xdgiconloader/xdgiconloader.cppxdgiconloader.cpp seems correct to me in its original form.

The source of the problem is unknown to me, but it makes newly installed apps have application-x-executable as their icons in Main Menu.

The patch is a compromise: it consults GTK icon cache if valid; otherwise, it'll revalidate it and search in the directory hierarchy if the icon isn't found in it — which is the whole point of the patch.

IMHO, a DE that can't show the icons of newly installed apps has a serious UX issue.

Closes https://github.com/lxqt/libqtxdg/issues/226

EDIT: Changed the description a litttle.

tsujan commented 2 years ago

FYI,

Here, the search in dir hierarchy is done on two occasions:

  1. When the GTK cache is invalid (as before); or
  2. When the GTK cache is valid but doesn't include the icon.

Remove 2, and the problem will reappear. Why? After testing several hypotheses to no avail, I don't have the slightest idea.

2 is the cost. Supposing that the cache will be updated soon, it should be temporary (because of cache->reValid(true);).

tsujan commented 2 years ago

Superseded by https://github.com/lxqt/libqtxdg/pull/284