On 2016-05-07 22:55, Allan Odgaard wrote:
Seems like when an app is activated with no key window on the current screen, it’ll make the frontmost window key, so we can do a workaround by delaying setting the key window until after TextMate has become active, e.g.:
if(![NSApp isActive]) { __weak __block id observerId = [[NSNotificationCenter
defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSApp queue:nil usingBlock:^(NSNotification*){ [aController showWindow:nil]; [[NSNotificationCenter defaultCenter] removeObserver:observerId]; }]; [NSApp activateIgnoringOtherApps:YES]; }
Where would I put this code to try it out?