More efficient invalidation and mouse handling using a quad tree