API change: one global event callback

Use a single event callback for all events instead of a window specific
event callback.

This should simplify dealing with events that are not tied to any
particular window.