New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gtk3.setupHook: clear icon-theme.cache in preFixup #68552
Conversation
fc34a04 didn't really touch mate because I'm not sure what's being done there or the old xfce because we're removing it anyways. |
fc34a04
to
834ece7
Compare
@jtojnar worldofpeace@bffc3be is to split the icon cache hook out of gtk3 so it can be used in gtk2. (gtk4 at some point as well) |
worldofpeace@bffc3be looks good. Maybe preserve |
Made sure it was everywhere 👍 |
Packages often run gtk-update-icon-cache to include their icons in themes’ icon cache. However, since each package is installed to its own prefix, the files will only collide. For that reason we are removing the icon-theme.cache from applications. Previously, we did that in hicolor-icon-theme setup hook but, since it is actually gtk3’s utility that creates the cache, we thought it would be appropriate to let its setup hook handle the clearing.
This was either for the setup-hook to remove caches or added even though the respective icon theme propagated it.
f47e4ed
to
b7ad6e1
Compare
</para> | ||
|
||
<para> | ||
To avoid costly file system access when locating icons, GTK, <link xlink:href="https://woboq.com/blog/qicon-reads-gtk-icon-cache-in-qt57.html">as well as Qt</link>, can rely on <filename>icon-theme.cache</filename> files from the themes’ top-level directories. These files are generated using <command>gtk-update-icon-cache</command>, which is expected to be run whenever an icon is added or removed to an icon theme (typically an application icon into <literal>hicolor</literal> theme) and some programs do indeed run this after icon installation. However, since packages are installed into their own prefix by Nix, this would lead to conflicts. For that reason, <package>gtk3</package> provides a <link xlink:href="#ssec-gnome-hooks-gtk-drop-icon-theme-cache">setup hook</link> that will clean the file from installation. Since most applications only ship their own icon that will be loaded on start-up, it should not affect them too much. On the other hand, icon themes are much larger and more widely used so we need to cache them. Because we recommend installing icon themes globally, we will generate the cache files from all packages in a profile using a NixOS module. You can enable the cache generation using <option>gtk.iconCache.enable</option> option if your desktop environment does not already do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<option>gtk.iconCache.enable</option>
should be something like <olink targetdoc="manual" targetptr="opt-gtk.iconCache.enable"/>
but the olinkDB is probably not set-up properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when mentioning gtk-update-icon-cache
can that be a link to https://developer.gnome.org/gtk3/stable/gtk-update-icon-cache.html also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to add <citerefentry><refentrytitle>gtk-update-icon-cache</refentrytitle> <manvolnum>1</manvolnum></citerefentry>
but did not manage to fit it in.
Perhaps the bit about the NixOS module isn't suited for the nixpkgs manual? |
Well most of gnome.xml is only meant for NixOS anyway. Too much global services and dependencies 😿 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to breeze-icons
look good to me!
gtk3.setupHook: clear icon-theme.cache in preFixup (cherry picked from commit f80e55f)
gtk3.setupHook: clear icon-theme.cache in preFixup (cherry picked from commit f80e55f) FWIW: ------- Conflicts: pkgs/applications/misc/tootle/default.nix pkgs/applications/networking/instant-messengers/fractal/default.nix pkgs/applications/search/catfish/default.nix pkgs/data/icons/elementary-xfce-icon-theme/default.nix pkgs/desktops/gnome-3/core/gnome-software/default.nix pkgs/development/libraries/gnome-online-accounts/default.nix pkgs/tools/misc/gparted/default.nix
Motivation for this change
Packages often run gtk-update-icon-cache to include their icons in themes’ icon cache. However, since each package is installed to its own prefix, the files will only collide. For that reason we are removing the icon-theme.cache from applications.
Previously, we did that in hicolor-icon-theme setup hook but, since it is actually gtk3’s utility that creates the cache, we thought it would be appropriate to let its setup hook handle the clearing.
Remaining tasks
icon-theme.cache
hicolor-icon-theme
. They should not use it, unless they are an icon theme, in which case, they should propagate it.buildInputs
and be sure to setdontDropIconThemeCache
.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @worldofpeace