Added some events handlers for visibility, size and position changed.