Fix document window couldn't be handled correctly after coloring canceled