Page 1 of 1

Menu is obscured by the top window

Posted: 10 Jul 2023, 01:52
by crocodile
Today I updated to 2.0.4, and I found that a menu that is displayed above the top window is not displayed anymore, it is blocked by this top window. In the version before 2.0.4, the menu was always displayed normally.
Is this a bug or a new feature that I didn't notice?

Re: Menu is obscured by the top window

Posted: 10 Jul 2023, 05:16
by crocodile
Sorry, this problem only occurs with AutoHotkey-H v2.0.4 maintained by thqby.
@thqby

Code: Select all

t:=gui()
t.show("x200 y200 w200 h200")
WinSetAlwaysOnTop 1, t.hwnd
MyMenu := Menu()
MyMenu.Add "Item 1", MenuHandler
MyMenu.Add "Item 2", MenuHandler
MyMenu.Add
MyMenu.Show(200, 200)
MenuHandler(Item, *) {
    MsgBox "You selected " Item
}

MsgBox

[Mod action: Moved topic from the main section to the AHK_H section.]

Re: Menu is obscured by the top window

Posted: 10 Jul 2023, 08:41
by thqby
I also merged v2.1-alpha.1, and @lexikos added code so that scripts can display menus without blocking, which also caused this problem.

Re: Menu is obscured by the top window

Posted: 10 Jul 2023, 08:51
by crocodile
Indeed, this problem also occurs in L2.1.
So should this topic be converted to the "Bug Reports" section?

Re: Menu is obscured by the top window

Posted: 02 Aug 2023, 22:47
by crocodile
@thqby This issue doesn't seem to be getting fixed anytime soon, can you fix it at ahk-h?

Re: Menu is obscured by the top window

Posted: 03 Aug 2023, 06:29
by thqby

Code: Select all

t:=gui()
t.show("x200 y200 w200 h200")
WinSetAlwaysOnTop 1, t.hwnd
MyMenu := Menu()
MyMenu.Add "Item 1", MenuHandler
MyMenu.Add "Item 2", MenuHandler
MyMenu.Add
WinSetAlwaysOnTop 1, A_ScriptHwnd
MyMenu.Show(200, 200)
MenuHandler(Item, *) {
    MsgBox "You selected " Item
}

Re: Menu is obscured by the top window

Posted: 03 Aug 2023, 17:02
by crocodile
I've modified it this way, but I'm using MyMenu.Handle, which has no effect. Thanks.

Re: Menu is obscured by the top window

Posted: 04 Aug 2023, 04:33
by thqby
crocodile wrote:
03 Aug 2023, 17:02
but I'm using MyMenu.Handle, which has no effect.
What do you mean?

Re: Menu is obscured by the top window

Posted: 04 Aug 2023, 06:13
by crocodile
Your method works.
I have done a similar modification, but I used "WinSetAlwaysOnTop 1, MyMenu.Handle" and it had no effect.

Re: Menu is obscured by the top window

Posted: 10 Nov 2023, 09:46
by crocodile
@thqby
Although this issue was fixed in v2.1-alpha.2, I found it to be incomplete.
If the window is topped, but not the active window. The menu will still be obscured.
I'm using Hv2.0.10 and I'm not sure if this is the same problem in L2 or H2.1.

Re: Menu is obscured by the top window

Posted: 11 Nov 2023, 03:13
by thqby
@crocodile
Is there any test code?

Re: Menu is obscured by the top window

Posted: 11 Nov 2023, 04:10
by crocodile

Code: Select all

t:=gui()
t.show("x200 y200 w200 h200")
WinSetAlwaysOnTop 1, t.hwnd
MyMenu := Menu()
MyMenu.Add "Item 1", MenuHandler
MyMenu.Add "Item 2", MenuHandler
MyMenu.Add
return
f1::
{
;Make sure the gui is not the active window
t.getpos(&x, &y)
MyMenu.Show(x, y)
}

MenuHandler(Item, *) {
    MsgBox "You selected " Item
}

Re: Menu is obscured by the top window

Posted: 11 Nov 2023, 05:53
by thqby
The issue cannot be reproduced, but there is an issue where the input focus is not on the menu.

Re: Menu is obscured by the top window

Posted: 11 Nov 2023, 06:28
by crocodile
Yes, in the latest H2.0.10 I didn't reproduce the problem. Sorry the H2.0.10 I'm using seems to be some older version. Maybe H should use a version marker somewhere. :)

Re: Menu is obscured by the top window

Posted: 11 Nov 2023, 06:47
by thqby
This will cause too many release tags. :oops:
So only the file was updated.