11
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NSWindowを常に最前面に出す

Last updated at Posted at 2015-07-27

ウィンドウを常に最前面に出す(どのSpaceでも/Fullscreenでも)常駐アプリっぽいのを作ろうとしたのですが、ちょっとハマったので書きます。

Custom OS X Application Target Propertiesの設定

Application is agent(UIElement)キーをYESで追加する必要があります。

20150728003430.png

これを知らずに、Fullscreenなアプリの上に出てこなくてハマりました。

NSWindowの設定

AppDelegate.m

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  [_window setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorFullScreenAuxiliary];
  [_window setLevel: NSFloatingWindowLevel];
}

11
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?