Simplify and fix logic when to trigger show events (should fix #232)