Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

missing icons for "new file" and "image" buttons in toolbar with Humanity theme

Open arxo opened this issue 8 months ago • 24 comments

Description There are missing icons for "new file" and "image" buttons in toolbar with Humanity theme. Note: the "New file" icon does show up properly in other apps like xed, I could not find one using the "image" icon.

To Reproduce

  • install LM 22
  • make Humanity theme available (sudo ln -s /usr/share/icons/Humanity /usr/share/icons/Mint-Humanity)
  • select Humanity icon theme in Themes setting
  • install Pinta 3.0 from Flathub
  • launch Pinta

Additional Info

Image vs

Image

Version Pinta 3.0, Linux Mint 22 .

arxo avatar Apr 14 '25 14:04 arxo

Hmm, I think these are standard icons so I'm wondering if they're missing from your icon theme somehow? Those two icon names are

  • document-new-symbolic
  • image-x-generic-symbolic

An example of an icon that is appearing properly is the open folder icon (document-open-symbolic) , so could you try checking the icon theme's folder to see what's present?

cameronwhite avatar Apr 14 '25 23:04 cameronwhite

Looks like those two are indeed missing. I only see these:

  • document-new
  • image-x-generic

but not the -symbolic variant of either.

arxo avatar Apr 15 '25 16:04 arxo

Here are all of the instances of the icons I could find:

$ find /usr/share/icons/ -name document-new-symbolic.* /usr/share/icons/Yaru/scalable/actions/document-new-symbolic.svg /usr/share/icons/Adwaita/symbolic/actions/document-new-symbolic.svg /usr/share/icons/Mint-X/actions/scalable/document-new-symbolic.svg /usr/share/icons/Papirus/symbolic/actions/document-new-symbolic.svg /usr/share/icons/Papirus-Dark/symbolic/actions/document-new-symbolic.svg

$ find /usr/share/icons/ -name image-x-generic-symbolic.* /usr/share/icons/Yaru/scalable/mimetypes/image-x-generic-symbolic.svg /usr/share/icons/Adwaita/symbolic/mimetypes/image-x-generic-symbolic.svg /usr/share/icons/Papirus/symbolic/mimetypes/image-x-generic-symbolic.svg /usr/share/icons/Papirus-Dark/symbolic/mimetypes/image-x-generic-symbolic.svg

Humanity does inherit from Adwaita, but that apparently does not help.

arxo avatar Apr 15 '25 17:04 arxo

Also Mint-Y (which does work) also inherits from Adwaita. Really confusing...

arxo avatar Apr 15 '25 17:04 arxo

Hmm, for comparison, what happens if you search for one of the working icons like document-open?

cameronwhite avatar Apr 15 '25 22:04 cameronwhite

$ find /usr/share/icons/ -name document-open.* /usr/share/icons/Humanity/actions/16/document-open.svg /usr/share/icons/Humanity/actions/48/document-open.svg /usr/share/icons/Humanity/actions/24/document-open.svg /usr/share/icons/Yaru/16x16/actions/document-open.png /usr/share/icons/Yaru/32x32/actions/document-open.png /usr/share/icons/Yaru/24x24@2x/actions/document-open.png /usr/share/icons/Yaru/48x48@2x/actions/document-open.png /usr/share/icons/Yaru/256x256@2x/actions/document-open.png /usr/share/icons/Yaru/32x32@2x/actions/document-open.png /usr/share/icons/Yaru/256x256/actions/document-open.png /usr/share/icons/Yaru/16x16@2x/actions/document-open.png /usr/share/icons/Yaru/24x24/actions/document-open.png /usr/share/icons/Yaru/48x48/actions/document-open.png /usr/share/icons/Yaru/22x22@2x/actions/document-open.png /usr/share/icons/Yaru/22x22/actions/document-open.png /usr/share/icons/HighContrast/16x16/actions/document-open.png /usr/share/icons/HighContrast/scalable/actions/document-open.svg /usr/share/icons/HighContrast/32x32/actions/document-open.png /usr/share/icons/HighContrast/256x256/actions/document-open.png /usr/share/icons/HighContrast/24x24/actions/document-open.png /usr/share/icons/HighContrast/48x48/actions/document-open.png /usr/share/icons/HighContrast/22x22/actions/document-open.png /usr/share/icons/Mint-X/actions/16/document-open.png /usr/share/icons/Mint-X/actions/48/document-open.png /usr/share/icons/Mint-X/actions/32/document-open.png /usr/share/icons/Mint-X/actions/24/document-open.png /usr/share/icons/Mint-X/actions/22/document-open.png /usr/share/icons/Papirus/16x16/actions/document-open.svg /usr/share/icons/Papirus/24x24/actions/document-open.svg /usr/share/icons/Papirus/22x22/actions/document-open.svg /usr/share/icons/Papirus/18x18/actions/document-open.svg /usr/share/icons/Papirus-Dark/16x16/actions/document-open.svg /usr/share/icons/Papirus-Dark/24x24/actions/document-open.svg /usr/share/icons/Papirus-Dark/22x22/actions/document-open.svg /usr/share/icons/Papirus-Dark/18x18/actions/document-open.svg /usr/share/icons/ePapirus-Dark/16x16/actions/document-open.svg /usr/share/icons/ePapirus-Dark/24x24/actions/document-open.svg /usr/share/icons/ePapirus-Dark/22x22/actions/document-open.svg /usr/share/icons/ePapirus-Dark/18x18/actions/document-open.svg /usr/share/icons/Mint-Y/legacy/512/document-open.png /usr/share/icons/Mint-Y/legacy/16/document-open.png /usr/share/icons/Mint-Y/legacy/48/document-open.png /usr/share/icons/Mint-Y/legacy/32/document-open.png /usr/share/icons/Mint-Y/legacy/24/document-open.png /usr/share/icons/Mint-Y/legacy/22/document-open.png /usr/share/icons/Mint-L/legacy/512/document-open.png /usr/share/icons/Mint-L/legacy/16/document-open.png /usr/share/icons/Mint-L/legacy/48/document-open.png /usr/share/icons/Mint-L/legacy/32/document-open.png /usr/share/icons/Mint-L/legacy/24/document-open.png /usr/share/icons/Mint-L/legacy/22/document-open.png /usr/share/icons/ePapirus/16x16/actions/document-open.svg /usr/share/icons/ePapirus/24x24/actions/document-open.svg /usr/share/icons/ePapirus/22x22/actions/document-open.svg /usr/share/icons/ePapirus/18x18/actions/document-open.svg /usr/share/icons/gnome/16x16/actions/document-open.png /usr/share/icons/gnome/32x32/actions/document-open.png /usr/share/icons/gnome/256x256/actions/document-open.png /usr/share/icons/gnome/24x24/actions/document-open.png /usr/share/icons/gnome/48x48/actions/document-open.png /usr/share/icons/gnome/22x22/actions/document-open.png

arxo avatar Apr 16 '25 13:04 arxo

Sorry, I meant to check for document-open-symbolic to see if there are any differences from document-new-symbolic that explain why it might not show up

cameronwhite avatar Apr 16 '25 23:04 cameronwhite

I tried replacing document-new-symbolic.svg in Adwaita with document-open-symbolic.svg, but that did not make any difference, so I don't think it's anything in the SVG file.

arxo avatar Apr 17 '25 16:04 arxo

Not really sure what else to suggest, since it's probably an issue with the custom icon theme, but you could try launching with GTK_DEBUG environment variable set to either icontheme or iconfallback to get some additional info from GTK https://docs.gtk.org/gtk4/running.html#gtk_debug

cameronwhite avatar Apr 17 '25 20:04 cameronwhite

The iconfallback option indeed lists several icons where no icon or fallback is found:

$ GTK_DEBUG=iconfallback flatpak run com.github.PintaProject.Pinta 

No icon found in Mint-Humanity (or fallbacks) for: Cursor.RectangleSelect.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.EllipseSelect.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.LassoSelect.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.MagicWand.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Paintbrush.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Pencil.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Eraser.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.PaintBucket.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Gradient.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.ColorPicker.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Line.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Rectangle.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.RoundedRectangle.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Ellipse.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.FreeformShape.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.CloneStamp.png
No icon found in Mint-Humanity (or fallbacks) for: Cursor.Recolor.png
...
No icon found in Mint-Humanity (or fallbacks) for: document-new-symbolic-ltr, document-new-symbolic, document-new-ltr, document-new
No icon found in Mint-Humanity (or fallbacks) for: edit-undo-symbolic-ltr, edit-undo-symbolic, edit-undo-ltr, edit-undo
No icon found in Mint-Humanity (or fallbacks) for: edit-redo-symbolic-ltr, edit-redo-symbolic, edit-redo-ltr, edit-redo
No icon found in Mint-Humanity (or fallbacks) for: image-x-generic-symbolic-ltr, image-x-generic-symbolic, image-x-generic-ltr, image-x-generic
...

For icontheme, the log is attached.

icontheme.log

arxo avatar Apr 18 '25 17:04 arxo

Yeah, from the icon theme log it doesn't seem like it finds the document-new icon anywhere, whereas it does list the document-open icon when it dumps out the icon theme's contents at the beginning. I don't see any mention in the logs of /usr/share/icons/Humanity though, but that might be related to Flatpak's sand boxing causing the paths to be remapped

I'm kind of suspicious about something theme-related not making it through the Flatpak sandbox, but I don't really know enough about this area to give more suggestions - this could be something to ask on a Flatpak forum since it's likely not specific to Pinta itself e.g. https://askubuntu.com/questions/1403931/how-to-apply-system-theme-to-flatpak-apps-that-use-gtk4/1540178#1540178 might have some ideas?

cameronwhite avatar Apr 22 '25 00:04 cameronwhite

I can confirm the same happens when installed through the snap package on Kubuntu 24.04.2

Jaypers avatar Apr 23 '25 21:04 Jaypers

I can confirm the same happens when installed through the snap package on Kubuntu 24.04.2

Is that also with the same Humanity icon theme as the original report?

cameronwhite avatar Apr 24 '25 03:04 cameronwhite

Is that also with the same Humanity icon theme as the original report?

That is with the default Kubuntu theme called Breeze.

Jaypers avatar Apr 24 '25 07:04 Jaypers

Would either of you be able to try running Pinta from source? I'd be curious to find out if it's related to the sandboxing of snap and flatpak. If not I can try to get a VM set up for testing this

cameronwhite avatar Apr 25 '25 02:04 cameronwhite

I can confirm that the compiled version doesn't have the issue. So it seems limited to the Snap version:

Image

I noticed that the compiled version uses a different icon theme which is an important clue. It looks like the Snap version isn't using the default Kubuntu Breeze theme for some reason.

Jaypers avatar Jun 11 '25 12:06 Jaypers

Thank you for testing!

cameronwhite avatar Jun 12 '25 03:06 cameronwhite

I don't understand Flatpak well enough to comment on that side, but from the Snap side, the icons for Breeze are most likely in the gtk-common-themes snap rather than Pinta itself, and updated externally to Pinta.

I know the Gnome extension for the snap will also do some logic regarding symlinking user directories for the GTK themes, though I'm unsure to what extent, and of course - this is actually GTK running in KDE Plasma, which complicates things a little.

Ultimately it's an interesting one, if I were looking at this purely as a snap problem, I'd presume the issue to be with the Gnome extension or the themes snaps. Since it happens in Flatpak too, it's more likely to be on the Pinta side, as any snap specific solution would be an ecosystem kind of solution where a fix for Pinta is upstream and effects more than Pinta.

@Jaypers could you please run the snap with debugging to compare against the Flatpak?

GTK_DEBUG=iconfallback pinta

JGCarroll avatar Jun 12 '25 16:06 JGCarroll

@JGCarroll unfortunately I don't use Flatpak and can't comment there but thank you for the pointers I've been able to solve my problem!

I first tried installing gtk-theme-breeze published by KDE but that didn't fix the issue then I installed icon-theme-breeze (also published by KDE) and the problem has been solved:

Image

@arxo since my issue was with Snap in the end, I must apologize for "hijacking" this issue but I thought it was related. Perhaps the solution for Flatpak would be similar?

Jaypers avatar Jun 13 '25 11:06 Jaypers

For the snap, that could be worth bringing up on the Snapcraft forum, as a common theme the desktop integrations should have really handle that magically for you, I'm wondering if icon-theme-breeze might be missing what we'd refer to as a global greedy autoconnection on the server side, or if you yourself don't have snapd-desktop-integration installed which is meant to react to theme changes and the like appropriately (when gtk-common-themes isn't enough but there's individual themes snaps available).

I've Googled Flatpak briefly, from what I expect, it works on a similar model to Snap here, where the themes are themselves Flatpaks, so for @arxo , I'd likely expect they need to install Mint-Humanity as a flatpak. From what I'm reading, Flatpak completely ignores /usr/share/themes but would attempt to automatically install the themes it can recognise in $HOME/.local/share/themes, though I don't have much knowledge and the ecosystem could have changed since; but it does make sense to me that /usr/share/themes is never actually checked.

JGCarroll avatar Jun 13 '25 12:06 JGCarroll

I managed to find a workaround (inspired by https://itsfoss.com/flatpak-app-apply-theme/) :

  1. remove the /usr/share/icons/Mint-Humanity symlink
  2. copy /usr/share/icons/Humanity to ~/.icons/Mint-Humanity
  3. change the name in ~/.icons/Mint-Humanity/index.theme to Mint-Humanity and save
  4. ensure the ~/.icons folder is exposed to Pinta in flatpak (e.g. via flatseal)

arxo avatar Jun 15 '25 16:06 arxo

Thanks for the update!

I've had a look at Flatpak now, theme Flatpaks are a thing, like theme snaps, e.g.,: https://github.com/flathub/org.gtk.Gtk3theme.Yaru-dark (the Ubuntu theme)

However, searching for Mint-Humanity (or just "Humanity") doesn't reveal anything.

It'd be ideal if the Mint-Humanity developers could upload this to Flathub so that Flatpak can automatically make use of it. Since that isn't the case from what I'm seeing in the Flathub repo, the above approach is the only solution besides changing the theme entirely to avoid the problem; and likely won't cause any problems with Pinta (there were historical concerns about themes back when e.g., GTK2 deployed themes as executable code, which will be why it's not done by default in both package managers).

JGCarroll avatar Jun 16 '25 07:06 JGCarroll

Well, the Mint-Humanity theme technically does not even exist. Linux Mint's theme selector was changed to only show themes that start with "Mint" (at least those in /usr/share/...). So I could make the Humanity theme available to most applications simply by creating a symlink named Mint-Humanity to the Humanity icon theme folder. I noticed that this does not apply to the ~/.icons , so there the theme name can be anything, as long as it does not clash with a system theme.

arxo avatar Jun 16 '25 13:06 arxo

FYI, I just opened issue #1836, which is similar to this one but not exactly identical, and looks like a more general problem.

arxo avatar Nov 07 '25 13:11 arxo