Hello,
I am having some NSWindow troubles... I have an NSWindow following my cursor like this:
The problem is when I click outside of my window (ex. the desktop) my NSWindow subclass stops following my cursor. Is there some way to keep my window in focus even when I click outside of my application?
I am having some NSWindow troubles... I have an NSWindow following my cursor like this:
Code:
- (void)mouseMoved:(NSEvent *)event
{
NSPoint p = [NSEvent mouseLocation];
NSLog(@"%s (%.1f, %1.f)", __PRETTY_FUNCTION__, p.x, p.y);
NSRect f = [self frame];
if (!NSPointInRect(p, f)) {
p.x -= f.size.width / 2.0;
p.y -= f.size.height / 2.0;
[self setFrameOrigin:p];
NSLog(@"%s Moved window to (%.1f, %1.f)", __PRETTY_FUNCTION__, p.x, p.y);
}
[super mouseMoved:event];
}
The problem is when I click outside of my window (ex. the desktop) my NSWindow subclass stops following my cursor. Is there some way to keep my window in focus even when I click outside of my application?