Ignore events not triggered by the widget listeners. Fixes #2177.