dialog: improved default event handling