jcsteh / osara

OSARA: Open Source Accessibility for the REAPER Application
GNU General Public License v2.0
127 stars 46 forks source link

When dismissing OSARA Configuration opened from the MIDI Editor, focus returns to the track view instead of the MIDI Editor #609

Closed ScottChesworth closed 2 years ago

ScottChesworth commented 2 years ago

I reckon there's a use case for this option to be toggle-able via an action that would be available in the MIDI Editor category. Here are steps to illustrate:

  1. You're using the MIDI Editor, and you realize that you'd be more productive for the next run of edits if the state of "Report MIDI notes in MIDI editor" was changed.
  2. Hit Control+F12 to load OSARA Config, adjust check box, dismiss OSARA Config.
  3. Here's the problem. Focus doesn't return to the MIDI editor, although it's still open on screen. It is possible to get focus back into that window, but only by either navigating the object hierarchy or using a virtual cursor of some kind (both of which are approaches that we don't expect every user will be familiar with).

Adding this action would avoid the issue. Users could toggle the state of "Report MIDI notes in MIDI editor" without leaving the MIDI Editor and subsequently needing to redirect focus.

Thanks in advance if there's anything you can do.

jcsteh commented 2 years ago

Seems reasonable. That said, I wonder whether the correct fix here is instead to stop the MIDI Editor from losing focus when the OSARA config dialog is dismissed. I think that should be possible and not too hard. It'd be nice if those REAPER Windows weren't so screwy when it comes to focus, but I guess that's the nature of floating windows.

ScottChesworth commented 2 years ago

Could fixing the focus loss apply to both platforms, though?

jcsteh commented 2 years ago

It should work cross-platform, yes.

jcsteh commented 2 years ago

A comment from Justin from Cockos on a different issue made me realise there's a really easy (and more correct) fix for this. Windows returns focus to the owner window when dismissing a dialog, so we should make sure the owner window is the right one.