Filter out events from background windows in most cases to avoid freezes when a background app is unresponsive.
The only exception so far is when background progress bar reporting is enabled, in which case background valueChange events are allowed.
To facilitate this, eventHandler.shouldAcceptEvent was introduced.