JuliaImages / ImageView.jl

Interactive display of images and movies
MIT License
135 stars 34 forks source link

ImageView sets environment variables that break other Gtk applications #272

Closed mgkuhn closed 2 years ago

mgkuhn commented 2 years ago

After loading ImageView, emacs (e.g. on Ubuntu Linux 20.04 with X11) started from within Julia (REPL shell mode) no longer works:

$ julia
shell> emacs

julia> using ImageView

shell> emacs

(emacs:11056): Gtk-WARNING **: 15:00:06.174: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Tango/24x24/status/image-missing.png: Unrecognised image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Tango/24x24/status/image-missing.png: Unrecognised image file format (gdk-pixbuf-error-quark, 3)

This appears to be caused by some GDK_PIXBUF_* environment variables that ImageView sets globally, which also affects other GDK applications invoked from within REPL shell mode:

$ julia
shell> bash -c 'env >a'

julia> using ImageView

shell> bash -c 'env >b'

shell> diff a b
12a13
> FONTCONFIG_PATH=/local/scratch/mgk25/julia-depot/artifacts/387d89822da323c098aba6f8ab316874d4e90f2e/etc/fonts
19a21
> GDK_PIXBUF_MODULE_FILE=/local/scratch/mgk25/julia-depot/artifacts/b8bc83ffc6c0ed0cec2840e238dd992d0c237707/loaders.cache
58a61
> GDK_PIXBUF_MODULEDIR=/local/scratch/mgk25/julia-depot/artifacts/6b2a012da13fab4cd3ed8374cd9faed6c1b9c387/loaders_dir
66a70
> FONTCONFIG_FILE=/local/scratch/mgk25/julia-depot/artifacts/387d89822da323c098aba6f8ab316874d4e90f2e/etc/fonts/fonts.conf
68c72
< XDG_DATA_DIRS=/usr/share/xfce4:/usr/share/xubuntu:/usr/local/share/:/usr/share/:/usr/share
---
> XDG_DATA_DIRS=/local/scratch/mgk25/julia-depot/artifacts/65eca7c48dea1e32203b205613441ce9506045b4/share:/local/scratch/mgk25/julia-depot/artifacts/eb6ac7b2d830e5142ad5e345e54fb33dc7aafd6c/share:/local/scratch/mgk25/julia-depot/artifacts/da375132597480d2f0e8e0831465bcebf78d4f18/lib/../share:/usr/share/xfce4:/usr/share/xubuntu:/usr/local/share/:/usr/share/:/usr/share
74a79
> XKB_CONFIG_ROOT=/local/scratch/mgk25/julia-depot/artifacts/be58fe5ecba3c97f24d6d6d13540b73f19c73e6f/share/X11/xkb

As a result, emacs no longer can find its icons.

mgkuhn commented 2 years ago

Probably more a Gtk.jl problem than an ImageView.jl one, as using Gtk has the same effect.

https://github.com/JuliaGraphics/Gtk.jl/issues/647