I have a floating NSPanel that is non-activating, i.e. its styleMask contains the NSNonactivatingPanelMask flag. Since this panel never becomes active, the system does not show the usual resize cursors when getting close to one of the panel's edges.

Is there a way to get those resize cursors to show up for a non-activating panel? E.g. the system's font panel pulls this off somehow.

有帮助吗?

解决方案

The [NSFontPanel sharedFontPanel].styleMask == (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSUtilityWindowMask). However, it shows resize indicators even if you add NSNonactivatingPanelMask.

When you set [NSFontPanel sharedFontPanel].hidesOnDeactivate = NO and activate another app, resize indicators stop working. This is by design, because even regular inactive windows cannot be resized.

So maybe you are trying to add resize indicators when the panel-owning app is inactive. Just a thought.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top