AutoHotkey 1.1.33.10 Main Window Displaying Unexpectedly
Posted: 03 Dec 2021, 17:23
[Moderator's note: Topic moved from Bug Reports.]
I have an AutoHotkey script that I run in the background that binds Win-Period to pop up a main menu:
What I'm seeing now is that when I hit the key sequence to show my "root" menu, it also unexpectedly opens the script's main window. When this happens, my root menu is on top, the AHK main window is below this, and my desktop and all other windows are below that. The main window stays up until I close it, even after a menu item is selected or the menu is dismissed. Also, when this happens, if I right click the AutoHotkey tray icon, it will show the main window in addition to popping up the application's context menu.
I tried using a simpler approach to popping up my menu by replacing the logic above with "Menu Root, show" but that had no effect.
This failure is intermittent, but once it starts happening, it happens 100% of the time I pop up my menu. If I close and restart my AutoHotkey script, the problem persists. This first happened to me ~2-3 months ago (on Windows 10 64-bit) and stopped happening a day or two later. It is now happening to me again on a new system using Windows 11, after my script had been working fine for nearly two months.
Any ideas what might be going on here?
I have an AutoHotkey script that I run in the background that binds Win-Period to pop up a main menu:
Code: Select all
;;; Win-Period: Pop up the root menu.
#.::
; Hack to try to ensure mouse focus, as described at:
; https://autohotkey.com/board/topic/101457-menu-loses-focus-ignores-keystrokes-sometimes/
Sleep 250
MouseGetPos MouseX, MouseY
MouseMove, %MouseX%, %MouseY%, 0
Menu Root, show, %MouseX% - 30, %MouseY% - 30
return
I tried using a simpler approach to popping up my menu by replacing the logic above with "Menu Root, show" but that had no effect.
This failure is intermittent, but once it starts happening, it happens 100% of the time I pop up my menu. If I close and restart my AutoHotkey script, the problem persists. This first happened to me ~2-3 months ago (on Windows 10 64-bit) and stopped happening a day or two later. It is now happening to me again on a new system using Windows 11, after my script had been working fine for nearly two months.
Any ideas what might be going on here?