App.EnableMenuItems fires every time app is brought to front

According to the docs, EnableMenuItems is

“Called when the user clicks in the menubar to give you the opportunity to determine which menu items to enable.”

which is what I expect and how it behaves for me under MacOS. Under Windows 11 running on Parallels, however, it fires every single time the app is brought to the front.

Has anyone else seen this? I’m running Xojo 2021r2.1.

DebugLog where no menu was clicked - just clicking on other windows and then back to that of my app:


I’ve seen this from 2018 upwards.

(Caused a horrendous issue when I added some code that removed/added menu items as under Windows, the whole menu seems to get destroyed and recreated. Huge flickering effects)

I can just about see a justification, since the window may want to try disabling top level menu items after being activated.
But I wouldnt expect it to fire unless someone tried to access a menu.

Jeez Louise… if they can’t or won’t fix it they could at least correct the documentation :confused: