Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac: Menu items does not trigger the expected action #1218

Closed
tbdalgaard opened this issue Mar 23, 2025 · 2 comments · Fixed by #1219
Closed

Mac: Menu items does not trigger the expected action #1218

tbdalgaard opened this issue Mar 23, 2025 · 2 comments · Fixed by #1219

Comments

@tbdalgaard
Copy link

This was discovered on RWP back in December 2024 by another member of the group, John.

I could not get a clean discussion link, so I have tried to make a short version from the thread here Note that the OSARA build versions are quite out of date, but the findings are still relevant in the latest development snapshots:

When going to the extensions and the OSARA submenu the follow menu items does not trigger the action they are bound to:

  • Online documentation
  • Check for update
  • Configure REAPER for optimal screen reader accessibility

Expected: When activating any of the menu items above the action should be triggered. Like online documentation, will show up in a browser window etc.
Observed: Menu closes and focus is back to the Reaper window.

This was first located around December 6th 2024.
I ran an older version of OSARA in a new, portable Reaper.
Version: 2024.10.18.1617,2b17b87b
Here all the menu items work as expected.
I then updated that version of OSARA to:
Version: 2024.12.18.1644,aae6bab6

After doing so the menu items stopped working again.

The actions work though, if I run them via the action list, so the code itself seems to work correctly.

@pitermach
Copy link

pitermach commented Mar 23, 2025 via email

@jcsteh
Copy link
Owner

jcsteh commented Mar 24, 2025

Thanks for reporting this and especially for providing the exact version numbers for the before and after builds you tried. That is enormously helpful in narrowing down a regression and saves a lot of time.

Looking at that commit range, I suspect this was caused by #1180 (Support interception of commands provided by extensions such as SWS). I don't fully understand why it breaks Mac but not Windows. However, in retrospect, I can see why it might break things in some cases. That change caused us to register OSARA commands later than we did previously. If the menu hook runs before our command registration code runs, that will break because our commands don't exist yet and so we can't get the correct ids to associate with the menu commands.

I need to think about how to fix this without breaking the thing I was originally trying to fix.

jcsteh added a commit that referenced this issue Mar 24, 2025
…1218, PR #1219)

In #1180, OSARA started registering all commands shortly after startup instead of immediately on startup.
This was done to enable interception of SWS commands.
Unfortunately, this broke items in the OSARA menu on Mac.
Presumably, the menu hook gets called slightly earlier on Mac, before our commands get registered, and so our menu items can't be associated with the correct command.
To fix this, we now register OSARA's commands immediately on startup, but we continue to register other commands that we want to intercept slightly later.
Developers should note that OSARA's own commands are now listed in the OSARA_COMMANDS array, not the COMMANDS array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants