Fixes recursively triggered repaint calls.