[TxMt] Re: Focus with multiple windows and displays

Allan Odgaard mailinglist at textmate.org
Sat May 7 20:55:40 UTC 2016

On 10 Apr 2016, at 18:45, Jacob Carlborg wrote:

> No, same behavior.

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];

More information about the textmate mailing list