gpui: Always recompute layout on cache miss. (#4131)

I'm not yet sure whether this is 100% correct, but it seems to alleviate
the following issue:
`When opening a dock, the panel doesn't appear right away. An empty dock
is briefly visible.`
Release Notes:

- Fixed panel layout being incorrect for a brief time after opening
(fixes https://github.com/zed-industries/community/issues/2415)
This commit is contained in:
Max Brunsfeld 2024-01-18 14:44:35 -08:00 committed by GitHub
commit 7860372beb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -321,10 +321,7 @@ impl Element for AnyView {
}
}
let mut element = state
.element
.take()
.unwrap_or_else(|| (self.request_layout)(self, cx).1);
let mut element = (self.request_layout)(self, cx).1;
element.draw(bounds.origin, bounds.size.into(), cx);
state.cache_key = Some(ViewCacheKey {