Unable to move window on Sonoma

Hi,

Updating a macOS application from Ventura to Sonoma, I encountered some issues, especially related to the new default value of -clipsToBounds (NO instead of YES previously), so that I had to add explicit definitions of this method in all my class views.

All these problems are fixed now, except for one that I can't solve and that may or may not be related:

The main window of this application has a toolbar containing a few custom views and using the NSWindowToolbarStyleExpanded style. In Sonoma, I can no longer move the window by clicking and dragging, even when I click on the title bar, and despite the fact that all my custom views inside this toolbar now have their -clipsToBounds method returning YES.

-isMovable however returns YES, -isMovableyWindowBackground returns NO, and the window receives the events. But -mouseDown: is only called when the window can't be moved, which seems to mean that the event wasn't properly caught somewhere.

Curiously, If I put the style to NSWindowToolbarStyleAutomatic, I can move the window again, but only by clicking on the left part (where is displayed the title and the following empty space).

Does anybody encountered such an issue on Sonoma ? Or have an idea to fix or work around this issue ?

Any help or advice is welcome, thank you!

I was able to reproduce the issue in a small test project:

It seems to be that some of my custom views return NO from -mouseDownCanMoveWindow to ensure that clicking-dragging them doesn't move the window. But, for some reason, the system applies that request to the full toolbar. This is weird, but fortunately less difficult to work around: as some sub-views of these views are sub-classes of NSControl, they already prevent moving the window, so that the undesired effect remains limited to small areas.

Unable to move window on Sonoma
 
 
Q