Skip to content
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

GVim built against GTK 3 can't find icons #44580

Closed
8573 opened this issue Aug 6, 2018 · 7 comments
Closed

GVim built against GTK 3 can't find icons #44580

8573 opened this issue Aug 6, 2018 · 7 comments

Comments

@8573
Copy link
Contributor

8573 commented Aug 6, 2018

Issue description

When I start a version of GVim from vim_configurable built against GTK 3, as is the default as of commit 9ac7ec7, I get the following message:

(gvim:16055): Gtk-WARNING **: 23:26:45.710: Could not find the icon 'document-open-ltr'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases

Versions of GVim from vim_configurable built against GTK 2 do not give me this message.

Steps to reproduce

$ nix-build -E '(import <nixpkgs> {}).vim_configurable.override {guiSupport = "gtk3";}'
$ ./result/bin/gvim

For comparison:

$ nix-build -E '(import <nixpkgs> {}).vim_configurable.override {guiSupport = "gtk2";}'
$ ./result/bin/gvim

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.48, NixOS, 18.09pre147850.2428f5dda13 (Jellyfish)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0.4
  • channels(root): "nixos-18.09pre147850.2428f5dda13"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@jtojnar
Copy link
Contributor

jtojnar commented Aug 6, 2018

Do you have any icon theme installed? gtk2 had stock icons built-in, whereas gtk3 requires an icon theme. Also, wrapGAppsHook should be added to gtk3 variant’s dependencies, since it is required for things like file chooser dialogues.

@8573
Copy link
Contributor Author

8573 commented Aug 7, 2018

I don't know what it would mean (in terms of NixOS options) to install an icon theme, so I doubt I have installed one.

@jtojnar
Copy link
Contributor

jtojnar commented Aug 7, 2018

Just add something like gnome3.adwaita-icon-theme to environment.systemPackages. Desktop environments should do that for you.

@8573
Copy link
Contributor Author

8573 commented Aug 7, 2018

While I'm unfamiliar with GVim's dialogues, I see that adding wrapGAppsHook to its nativeBuildInputs does allow it to display a file-chooser dialogue; however, for me, opening this file-chooser dialogue produces many of the following warnings:

(gvim:21398): dconf-WARNING **: 20:08:07.668: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files

Adding gnome3.adwaita-icon-theme to environment.systemPackages indeed does fix the warning from my initial report (thanks!). Should the NixOS manual suggest, as it currently does not, installing such an icon theme if one doesn't install a desktop environment?

Even with the adwaita-icon-theme installed, opening GVim's find/replace dialogue produces the following warning, which I suppose indicates some further GNOME package I'm missing:

(gvim:21404): Gtk-WARNING **: 20:28:51.298: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/bullet-symbolic.svg.
This may indicate that pixbuf loaders or the mime database could not be found.

@jtojnar
Copy link
Contributor

jtojnar commented Aug 7, 2018

however, for me, opening this file-chooser dialogue produces many of the following warnings:

Yes, adding gnome3.dconf to services.dbus.packages is another thing you need to do if you build your DE yourself.

Should the NixOS manual suggest, as it currently does not, installing such an icon theme if one doesn't install a desktop environment?

I was contemplating a section on creating custom DEs. In addition to icons and dconf, it could suggest things like polkit, udisks or other things you will see in a full DE. Or maybe this could go to wiki – if I recall correctly, some of the errors from above are already listed there.

Even with the adwaita-icon-theme installed, opening GVim's find/replace dialogue produces the following warning, which I suppose indicates some further GNOME package I'm missing:

Yup, that would be librsvg gdk_pixbuf loader. You could fix it like this:

GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";

Though I would expect wrapGAppsHook to take care of that.

@8573
Copy link
Contributor Author

8573 commented Aug 7, 2018

Yes, adding gnome3.dconf to services.dbus.packages is another thing you need to do [...]

I've done so, and also set programs.dconf.enable = true, and rebooted, and the file-chooser dialogue now works without warnings. Thanks.

Would it make sense for programs.dconf itself to add gnome3.dconf to services.dbus.packages?

Or maybe this could go to wiki – if I recall correctly, some of the errors from above are already listed there.

Is there a wiki still? I thought it was shut down.

Though I would expect wrapGAppsHook to take care of that.

Ah, indeed it does; I had forgotten to test that.

@jtojnar
Copy link
Contributor

jtojnar commented Aug 7, 2018

Would it make sense for programs.dconf itself to add gnome3.dconf to services.dbus.packages?

Yes, I am not sure why it already is not there.

Is there a wiki still? I thought it was shut down.

Yup, we had a new one for a while now: https://nixos.wiki/

8573 added a commit to 8573/nixpkgs that referenced this issue Aug 7, 2018
As suggested by @jtojnar in GitHub issue NixOS#44580, this patch adds the
package `wrapGAppsHook` to the dependencies (specifically, the
`nativeBuildInputs`) of `vim_configurable`, when `vim_configurable` is
built against GTK 3.

This change prevents GVim from crashing if one tries to use its
file-choosing dialog, and fixes a warning that otherwise might be
emitted if one tries to use its find/replace dialog.
xeji pushed a commit that referenced this issue Aug 9, 2018
As suggested by @jtojnar in GitHub issue #44580, this patch adds the
package `wrapGAppsHook` to the dependencies (specifically, the
`nativeBuildInputs`) of `vim_configurable`, when `vim_configurable` is
built against GTK 3.

This change prevents GVim from crashing if one tries to use its
file-choosing dialog, and fixes a warning that otherwise might be
emitted if one tries to use its find/replace dialog.
@jtojnar jtojnar closed this as completed Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants