fixed order of handling mouse clicks on gadgets and on global animations