Page 1 of 1

tray menu disappear

Posted: 20 Feb 2024, 22:23
by pattazl
environment:
1. win11
2. have 2 monitors ( monitor 1, monitor 2)
3. AHK V1 / V2

condition:
1. set monitor 2 as main monitor
2. move AHK gui dialog to monitor 1

bug:
AHK system tray menu disappear

Re: tray menu disappear

Posted: 21 Feb 2024, 02:03
by pattazl
Monitor1 is the default main monitor, set monitor 2 as main monitor
use window spy , the Mouse position is diffrent when left click/right click on tray

Re: tray menu disappear

Posted: 22 Feb 2024, 01:52
by pattazl
When AHK gui dialog is hidden, the tray menu work well, but if dialog in show , the tray menu will disappear

Re: tray menu disappear

Posted: 01 Mar 2024, 00:11
by lexikos
"tray menu [will] disappear" makes no sense to me. If the tray menu is visible, any attempt to interact with any other window, such as to move the GUI, would be expected to cause the tray menu to disappear, because it has lost focus. If the tray menu wasn't already visible, it can't disappear.

I guess you mean that under those conditions, the tray menu will not appear when you right click on the icon.

I replicated the conditions you described and was unable to produce any unexpected or abnormal behaviour. The tray menu is correctly shown at the mouse pointer's current location regardless of which screen the GUI is on.

The "Window" mouse position is relative to the active window. If you right click on the tray icon, the script activates its own window in order to give the tray menu focus. In other words, the "Window" mouse position becomes relative to the script's window instead of the taskbar.

Re: tray menu disappear  Topic is solved

Posted: 09 Mar 2024, 09:51
by pattazl
After replacing my laptop, I couldn't reproduce it, and I don't know the root cause. Next time, I will record a video to show it .
Clicking the tray menu is invalid and does not pop up a menu :(