phil294 / AHK_X11

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

Script sometimes fails to reload, and cannot be launched from another script #53

Closed davidhfo closed 11 months ago

davidhfo commented 11 months ago

Sometimes when the hotkey's tray icon menu option for reloading the script is clicked, the script fails to reload. It will just close but not restart.

I know that doesn't say much, but if there's data I can get to help debug, let me know.

Possibly related: Using a hotkey in a script to load another script via Run, bash -c '/path-to-app/ahk_x11-1.0.1-x86_64.AppImage "/path-to-script/script.ahk"' does not work.

But using the same hotkey to instead do something like Run, bash -c kate works just fine.

The following from a terminal also works fine: /path-to-app/ahk_x11-1.0.1-x86_64.AppImage "/path-to-script/script.ahk"

Minor issue for me personally, because I don't reload often, and can easily start it up again from the command line.

This isn't an issue I experienced in 0.5.1.

Solus 4.4, Plasma edition

phil294 commented 11 months ago

this was actually due to the other issue of yours: The window flashing set the focus to the non-existing window ID 0 and then any subsequent startups of ahk_x11 immediately crashed because they couldn't register hotkeys on 0.

Apart from the solution in #51, I also fixed this by redirecting 0-grabs to the root window instead.