Sonoma breaks single-line editfields with no border/focus ring by allowing them to draw outside of their rect. My code to remedy this has no effect. Any help?
Public Sub SetClipsToBounds(tf As DesktopTextField, value As Boolean)
Declare Sub wantsDefaultClipping Lib "AppKit" selector "setWantsDefaultClipping:" (obj As Ptr, value As Boolean)
Declare Sub setClipsToBounds Lib "AppKit" selector "setClipsToBounds:" (obj As Ptr, value As Boolean)
Declare Function clipsToBounds Lib "AppKit" selector "clipsToBounds" (obj As Ptr) As Boolean
Var bset As Boolean = clipsToBounds(tf.Handle)
If bset <> value Then Break
The workaround is to do this every time it gets focus…
Sub FocusReceived() Handles FocusReceived
Send a Feedback to Xojo as this should not be happening. Several possibilities.
- It’s a bug in beta OS release…
- Xojo is declaring the SDK to be macOS 14 (which it should not yet).
- The Xojo framework is fighting with you and resetting the property (it does do this for many other things, so it is possible).
For applications linked against the macOS 14 SDK, the default value of this property is
false. Apps linked against older SDKs default to
true. Some classes, like
NSClipView, continue to default to
true. The change in defaults recognizes that it is vastly easier to reason about clipping a view’s descendants than it is to unclip a view’s ancestors.
Users can turn clipping back on by using the
NSView.clipsToBounds setter or using the attributes inspector of a view in the Xcode interface builder.
Still broken on the retail release. Xojo maybe is linking against the wrong SDK then?