Merge branch 'osx-window-invalidate-inset-cache' of github.com:ryancog/wxWidgets

Add wxWindow::MacInvalidateInsetCache() to wxOSX/Cocoa.

See #26625.

Closes #26622.
This commit is contained in:
Vadim Zeitlin
2026-06-30 22:32:30 +02:00
3 changed files with 22 additions and 0 deletions
+4
View File
@@ -204,6 +204,10 @@ public:
virtual long MacGetTopBorderSize() const;
virtual long MacGetBottomBorderSize() const;
// Must be called whenever window style changes result in changes to layout
// insets (`-[NSView alignmentRectInsets:]`, used for MacGetBorderSize())
virtual void MacInvalidateInsetCache() const;
virtual void MacSuperChangedPosition() ;
// absolute coordinates of this window's root have changed
+13
View File
@@ -66,6 +66,19 @@
}
}
- (void) setBezelStyle: (NSBezelStyle) s
{
[super setBezelStyle:s];
// Setting the bezel style may change the layout insets, so the cache
// needs to be invalidated to avoid incorrect layout.
// Done here so it's handled for both internal wx usage and application
// code when accessed with `wxWindow::GetHandle()`
auto *impl{wxWidgetImpl::FindFromWXWidget(self)};
if (impl)
impl->InvalidateLayoutInset();
}
- (void) setTrackingTag: (NSTrackingRectTag)tag
{
rectTag = tag;
+5
View File
@@ -2344,6 +2344,11 @@ long wxWindowMac::MacGetBottomBorderSize() const {
return MacGetBorderSize().bottom;
}
void wxWindowMac::MacInvalidateInsetCache() const {
if ( GetPeer() )
GetPeer()->InvalidateLayoutInset();
}
long wxWindowMac::MacRemoveBordersFromStyle( long style )
{
return style & ~wxBORDER_MASK ;