I have an NSWindow (my main window) and a child window (the NSWindowBelow located main window) that has an NSTextView . There is no title bar, shadow, or transparency in the child window.
Here is the code that I use to configure my child window to make it transparent:
- (id) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag{ if (![super initWithContentRect: contentRect styleMask:NSBorderlessWindowMask backing: bufferingType defer:NO]) return nil; [self setBackgroundColor: [NSColor clearColor]]; [self setOpaque:NO]; return self; }
But when I try to select the text in it, this is what happens (the black window above the child window is the main window):

It seems that NSTextView not focused, because the selection is not blue. I tried calling: [[_childWindow textView] becomeFirstResponder]; but the result is the same. Another thing is that when I scroll it, sometimes it is very laggy and βbrokenβ.
Do you guys have any ideas on what causes this and how to fix it? I suspect because there is no title bar in the window, but I'm not sure. Thanks!
source share