added XFlush to window_canvas