Better theme event logic
Merge branch 'master' into ST3