Removed duplicate triggerEvent code, and refactored it so that events can be triggered on any object. For example, the Objective-C application could trigger the "blur" event on "window".
By default, events are still triggered on "document", so this shouldn't break anything.
This was useful when I fixed some bugs related to focus/blur handling and Spaces (it's going to be a separate pull request), and you could also use it to trigger some custom events from menus etc.
Removed duplicate triggerEvent code, and refactored it so that events can be triggered on any object. For example, the Objective-C application could trigger the "blur" event on "window".
By default, events are still triggered on "document", so this shouldn't break anything.
This was useful when I fixed some bugs related to focus/blur handling and Spaces (it's going to be a separate pull request), and you could also use it to trigger some custom events from menus etc.