phil294 / AHK_X11

AutoHotkey for Linux (X11-based systems)
GNU General Public License v2.0
770 stars 11 forks source link

Issues opening GTK application #37

Closed pickpj closed 1 year ago

pickpj commented 1 year ago

Arch - KDE Plasma 5.27.2 AHK_X11 Version 0.5.0
Problem: Failure to open "gnome-genius"
Attempts to fix: Tried to manually add breeze-dark/status/64/image-missing.svg to /tmp/.mount_ahk---/usr/share/icons , but couldn't get permissions working.

Demonstration: gnomegenius Error when ran in konsole:

Gtk-Message: 11:39:25.969: Failed to load module "canberra-gtk-module"
Gtk-Message: 11:39:26.003: Failed to load module "colorreload-gtk-module"
Gtk-Message: 11:39:26.003: Failed to load module "window-decorations-gtk-module"

(gnome-genius:104660): Gtk-WARNING **: 11:39:26.053: 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/gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share
/icons/breeze-dark/status/64/image-missing.svg: Unable to load image-loading module: libpixbufloader-svg.so: libpixbufloader-
svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../gtk/gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load 
/usr/share/icons/breeze-dark/status/64/image-missing.svg: Unable to load image-loading module: libpixbufloader-svg.so: 
libpixbufloader-svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)

Warning: Program 'gnome-genius' crashed.
phil294 commented 1 year ago

thanks for the detailed report. Most likely related to AppImage linuxdeploy-plugin-gtk. That script does some black magic and probably sets some environment variables that spawned sub gtk processes don't expect.

Can you verify it works with NumpadEnd::Run, sudo -u %A_UserName% -i bash -c 'konsole -e "gtk-demo"'?

If this works then I think the proper solution is to change the internals of Run/RunWait to unset all variables export-ed by linuxdeploy-plugin-gtk.sh every time. But first I have to research if there is any danger in doing so

also, sorry for the message spamming (if you have email notifications activated), I can't type today apparently

pickpj commented 1 year ago

Thanks, this solution worked for me! :D I'll leave closing up to you.

phil294 commented 1 year ago

Hi @picklepissjar, I think I have resolved this now. As I don't have a way to reproduce and verify this bug right now, could you kindly test if this is fixed with the most recent release version 0.5.1? https://github.com/phil294/AHK_X11/releases/tag/0.5.1 (without the sudo workaround thing). Then I can mark the release as ready

pickpj commented 1 year ago

Tested in 0.5.1 and it is working without the sudo workaround. :)

phil294 commented 1 year ago

great, thanks