Added window button handling