adventuregamestudio / ags

AGS editor and engine source code
Other
707 stars 159 forks source link

Editor: fix pressing alt doesn't select File in menu #2572

Closed ericoporto closed 1 week ago

ericoporto commented 2 weeks ago

fix #2566

From the MSDN docs on the property, it appears it was just something it was not set by accident.

ivan-mogilko commented 2 weeks ago

There's still an issue with floating panes: when there's an active float pane, its window menu is focused instead.

ericoporto commented 2 weeks ago

I am not sure how to fix that in AGS, it appears that issue is in the dockpanel. I saw a commit online that I think fixes this in it: https://github.com/tsanie/dockpanelsuite/commit/ac583863655c3dbd96b876843272e7e5df84fb38#diff-3278c81de04fbf296b216c4dc761a9a57ae9b5cf17d75c599160b21d0f8eec33R291

I tested this in VS2022 itself (not AGS Editor) and pressing Alt alternates focus between the floating window and the main window, with the main window having the "File" menu entry highlighted.

Edit: uhm, perhaps if I can do it in Editor Content Panel it would work.

Edit2: nope, tried, doesn't work, wndproc isn't getting called when I press Alt. Can't quite figure how to pass the Alt lone press to the main form. Right now, hitting Alt there just does nothing for me, no menu opens in the floating pane.

ivan-mogilko commented 2 weeks ago

Edit: uhm, perhaps if I can do it in Editor Content Panel it would work.

Since it is Docking.FloatWindow that implements this form which has its window menu selected, then it's the one which has to be looked into. Maybe it could be reconfigured upon creation, or have some handler attached to it. I know that there has to be ways to intercept window messages. This is not a exact solution, only taking notes for now.

I also usually have hard times understanding connections between AGS.Editor gui objects and docking classes, especially because these hide beyond custom interfaces (i suspect that this was done for the sake of editor plugins).

ivan-mogilko commented 1 week ago

I will merge this, as this might fix the problem for the majority of layouts (not sure if anyone is using floating panes often).

I tried few things, but it looks like it's a standard behavior for the child popup windows inside a parent window to steal focus and alt key as well. Note that it's not the presence of a floating pane that steals the Alt key, but the focus: if you click on background, the main window gets focus, and then Alt key goes to Main Menu as usual.

This remaining issue does not seem like worth spending more time on it (and idk if it's even theoretically possible to solve without bigger hacks like preprocessing messages on Application level...)