C# Cocoa app, button images stretched

Hi,

One of my developers has upgraded their office Mac to Sonoma. The app we build has a WPF Windows UI layer, GTK for Linux and Cocoa for Mac, the code being written in C#. On Ventura, it builds and works fine. However, since he's upgraded his Mac to Sonoma, all the images on buttons are stretched to take up the whole size of the button, rather than the position stated, with text underneath.

I can't share a screenshot here - it's an internal build not for customer or public use.

The following mockups demonstrate what we're seeing:

Code built on Sonoma

Exact same code built on Ventura

Any suggestions?

Probably another victim of the clipsToBound change. NSView clipsToBound is set to false when compiling with the macOS 14 SDK. If the code drawing the button uses the dirty rect instead of the bounds, it will draw in weird way. Is that button image drawn by a subclass you wrote?

C# Cocoa app, button images stretched
 
 
Q