Without a screenshot, it's hard to tell exactly what your repaint bug is, but there are several known issues with Unity and z-ordering (e.g. if the previously-background window doesn't repaint the area overlapped with the previously-foreground window, this is known).