Is there a way to force the focus back on the plugin window after an action outside of it? When dropping an item to an IDropTarget, from a folder to the plugin GUI, the focus is set to the folder window, not on the GUI anymore. Is there a method I could call in the “onDrop” method to force the view back to the plugin window?
What is the folder window? Do you mean an OS file browser window from Finder or Explorer?
Yes, the file browser window
How does the system behave, if you copy a file from one window to another. If the source window has focus and you drop a file to another window, does the other window get focus afterwards? On macOS it does not change the focus to the destination window. So I think this is expected behavior, no?
You are right. If the source window has focus and you drop a file to another window, the other window doesn’t get focus afterwards on macOS.
But I want to “force” this behaviour, because after dropping the file to the plugin window, the whole plugin GUI should update itself. In Reaper this doesn’t happen unless I click again the plugin window (or Reaper window). This is why I want to set the focus back to the plugin window after dropping the file. In other DAWs I don’t see this issue though.
As the host is the owner of the window, it is responsible for setting the focus window. You as a plug-in are not allowed to alter the window in any way. If reaper behaves not as you like you may can ask the developers if it is the intended behavior or a bug if all other hosts does it different.