Fix button state being shared by all open windows.