Built app doesn't fire menu handlers

Does anyone else have problems with menu handlers not firing at all in 2020r2.1?

As far as I can see the problem is a Rosetta one. First I thought that the problem was only in the debugger. But it’s in the built app, too. I’ve also gotten reports from the first testers. “App quit only on the third try”.

I can reliably reproduce the behaviour in the debugger today. This does not fire any menu handler:

And this does:

In the build app I haven’t been able to reproduce the behaviour. It works one launch and it doesn’t work the second launch.

Any idea what I might have screwed up?

Even if I run as Intel? I’ll make a test with debugging/building for ARM. I can also try to load my project into 2019r3.

Right now I’m in the guessing stage. The only thing I know is that I see the problem on M1/2020r2.1 and higher.

Sorry, had to delete my reply because it referred to the prerelease.

The current release of my app is done with 2019r3 and I haven’t heard anything about problems with the menu there.

I get the same behaviour in 2020r2.1 when compiling for ARM. So not a Rosetta problem but something between Xojo and BS.

I am sorry, I don’t understand. Are you saying that actions don’t fire when you select menuitems?

What is the difference between the two screenshots?

Have you set your application to crash on NSException in case there’s something causing one?

Should have been clearer: Doing any menu shortcut with Cmd-Q or Cmd-R doesn’t work at all sometimes. Selecting the menu item from the menu always works fine. I’ve set breakpoints in the debugger in the menu handler. Those don’t fire.

In the second screenshot I have loaded data into the NSTableView.

There was no crash. This happens straight when starting the app - either in the debugger or when building.

So your problem in few words seems: Menu handlers mostly don’t fire when invoked by keyboard shortcuts, causing bad UX.

1 Like

Ah, okay, I understand now.

So, open a Feedback case with an example, or maybe you won’t see a fix. Explain the problem and how to reproduce it in few words, using latest Xojo, and tell them your OS version. No need to use your app as example.

When the menu handlers won’t work, do you get a KeyDown event instead?
(trying to understand what’s going on)

I’ve seen a (possibly related) problem in the IDE for years - most commonly, when Remote debugging, for which the key combo is Option Command R. I can remote debug this way about half a dozen times, but at some point it simply stops working.

It feels like it may depend on what windows/tabs/panels/controls are visible or in focus?

In my experience the solution is to restart the debugger stub. It somehow gets into a bad state and can’t accept new connections.

That’s a different bug :slight_smile: In my case, when Command-Option-R no longer works, clicking the Remote Debug menu with the mouse still works. It’s pretty clear that it’s the menu shortcut keys not working in this case.

Also: I notice in recent IDE versions, I can no longer quickly type:

  • Command S (save)
  • Command R (run)

Often the Command R will beep.

In older IDEs, the fast combo of Command S, Commmand R would save and run 100% reliabilty.

Did something change witih menu handling event code?

I’m often seeing Cmd-R not working in the debugger. But for me on BS the menu handlers don’t fire at all when I do any menu shortcut.

The keydown events also don’t fire when the menu shortcuts don’t work.

If I remember correctly, one of the macOS SDK updates caused menu hotkeys to not “queue up” for execution and so the ability to press Command-R before Command-S was complete was lost and now you actually have to wait.

Another “papercut” annoyance with modern versions of the macOS.

I found 2 menuitems with the same shortcut. Ahem - this has been working since forever. After removing the second shortcut the menuitems worked after clicking somewhere.

I then started removing classes. As a total surprise an off-window container with a html viewer that I use for printing and PDF generation was the culprit. After moving the container to an additional pagepanel everything now works fine.

Knock on wood!


My experience with this is that when you have two with the same shortcut, the first one fires, left to right, top to bottom.

That’s probably why I never noticed the problem in too many years.

On BS/M1 the difference was big. Before, the menu shortcuts mostly didn’t work at all. After removing the second shortcut things were much better.