NSWindowこれは、私のサブクラスのコンストラクターですFullScreenWindow。
- (id)initWithScreen:(NSScreen *)s {
NSRect contentRect = [s frame];
self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO
screen:s];
if (self) {
[self setCollectionBehavior:NSWindowCollectionBehaviorStationary|
NSWindowCollectionBehaviorCanJoinAllSpaces|
NSWindowCollectionBehaviorIgnoresCycle];
[self setReleasedWhenClosed:YES];
[self setBackgroundColor:[NSColor greenColor]];
[self setAlphaValue:1.0];
[self setOpaque:NO];
[self setLevel:NSMainMenuWindowLevel-1];
}
return self;
}
NSWindowすべてのディスプレイにそのようなものを追加したいのですが、2 番目のディスプレイを接続すると、最初のディスプレイ (および2 番目のディスプレイ)にを設定した[NSScreen screens]場合にのみ、ウィンドウが正しい方法で表示されます。インスタンスのフレームの値を取得すると、最初の表示と2 番目の表示に戻ります。これらの座標がずれているのはなぜですか?origin.xcontentRect-14400origin.xNSScreen01440
