I don't think we need to keep track of the current visibility in a global widget variable. Caching the default visibility should be enough.