Is there any way to prevent macOS from moving my app’s windows?

My app (AppKit, not SwiftUI) displays a small utility window. I can place it over the menu bar, or in the area beside the notch on my MacBook Pro (when it is a secondary screen), but if the screen goes to sleep and I wake it, macOS has moved the window off the menu bar or down out of the notch area.

Is there any way to indicate a window should never be moved by the OS?

No.

But you should be able to specify a position for those windows when you get back from sleep.

Could you show the size attributes for this window ?

Is there any way to prevent macOS from moving my app’s windows?
 
 
Q