Fixed buffer being flipped even when there is no active window