lxqt / lxqt-panel

The LXQt desktop panel
https://lxqt-project.org
GNU Lesser General Public License v2.1
194 stars 135 forks source link

Fancy Menu: Icons for some applications not appearing immediately #2172

Closed isf63 closed 1 week ago

isf63 commented 1 week ago
Expected Behavior
Current Behavior

Icons for some applications do not consistently show immediately.

Possible Solution
Steps to Reproduce (for bugs)
  1. Install mgba-qt and pcsx2. Note: The relevant icons are - /usr/share/pixmaps/io.mgba.mGBA.png and /usr/share/pixmaps/PCSX2.png.
  2. Restart the panel.
  3. In Fancy Menu open any category other than the "Games" category. (This step is not always needed)
  4. Open the "Games" category. For these two applications there will be no icons until going out of, then back into, the category. This fixes the bug until next panel restart.
Context

I opened https://github.com/lxqt/libqtxdg/issues/305 previously in part due to this issue. But the example there turned out to be unrelated.

System Information
tsujan commented 1 week ago

Usually, reports shouldn't require installations. Anyway, I installed mgba-qt from Arch. It had only one item under the Games category, whose icon was loaded with a one-second delay at first. That's not unexpected for a 256-px PNG icon inside /usr/share/pixmaps/, because there's no icon cache there and it's the last place that's searched.

tsujan commented 1 week ago

I closed the report not because it wasn't valid (it was, and thanks for reporting!), but because there's nothing to do about it.

isf63 commented 1 week ago

A few things:

tsujan commented 1 week ago

It looks like this bug is only present when using auto-select in Fancy Menu.

I know that you're describing your observation, but auto-selection has nothing to do with icons.

The large, uncached icons will not be loaded

In my case, the icon was loaded with a short delay, without me changing the category. The cause of delay may be three things, all of which are out of our control: lack of icon cache inside the pixmaps folder, the big icon size, or how QListView reacts to them. To rule out or confirm the third cause, please test with Main Menu too.

isf63 commented 1 week ago

or how QListView reacts to them. To rule out or confirm the third cause, please test with Main Menu too.

Main Menu seemingly works in this case with no problems at all.

tsujan commented 1 week ago

Then it can be about how QListView works — probably a regression.

If you're interested, you could resize those icons to 48px and see if that'll make a difference.

isf63 commented 1 week ago

Resizing them down to 48x48 still produces the bug. It must be due to /usr/share/pixmaps/ then, specifically in Fancy Menu.

tsujan commented 1 week ago

it must be due to /usr/share/pixmaps/ then

Hard to tell for sure, but yes, maybe. QMenu may do the needed computations before being shown, while QListView does it after being shown.

I remember a similar case in pcmanfm-qt. The icon of "Electron" was shown with a delay inside /usr/share/applications/. It was a huge icon (1024x1024) inside /usr/share/pixmaps/. The problem was fixed after I made a reasonable SVG icon for Electron, added it to my icon set, and updated its cache.