See #26318
The first commit da08c57 is the interesting one. As noted, it's unclear if there's ever a time where the insets would be invalidated and would need to be refetched, but the Apple documentation is sparse on how the usual Auto Layout system would query it. It doesn't seem like something that would ever change, but worth noting.
The second and third commits are related, but may deserve their own PR.
The second commit 25e46b9 adds MacGetBorderSize() following the logic that the MacGet*Border... functions are almost never called on their own, and in fact GetLayoutInset() always returns all the values, so it's (superficially... it ultimately doesn't matter much for performance and is moreso semantic I guess) "wasteful" in the current setup w/o a way to grab all of the values, as would be more natural given the underlying API.
The third commit 7b2307e uses the new function where appropriate in wxCocoa code and, IMO, cleans things up a bit.
I've added wxMacBorderSize as it doesn't seem like there's an already-existing suitable structure, and 25e46b9 also removed m_macTopLeftInset and m_macBottomRightInset from wxWindowMac as those are never used, and seem like they were intended to be used to store these inset values. But such storage makes more sense in the Impl class.
https://github.com/wxWidgets/wxWidgets/pull/26353
(6 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The only reason I've made this a draft is to ask opinion on the two refactor commits, and in case there's any known notable reason where the cache should be cleared.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()