title: Making NSBordlessWindow key and active when main application window is not active
body: <p>I have a custom <code>NSBorderlessWindowMask</code> window in my application that I show when user taps a certain hot key.
  This window has a `NSTextField, that has to become first responder when the window shows up.
  This window is not a main window, but it can take focus from the main window.
  This what I do to show it and make it key:</p>
  
  <pre><code>[self.myCustomWindow makeKeyAndOrderFront:sender];
  </code></pre>
  
  <p>and then to set the first responder</p>
  
  <pre><code>[self.myTextField becomeFirstResponder];
  </code></pre>
  
  <p>Everything works as expected when the application is a frontmost application,
  but if it's not, the window appears, but doesn't become key and i have to click it to become active.</p>
  
  <p>I override in my <code>CustomWindow</code> class:</p>
  
  <pre><code>- (BOOL)canBecomeKeyWindow {
  
      return YES;
  }
  </code></pre>
  
  <p>What might be the problem?</p>
  
  <p>Thanks!</p>