I have two displays. If I have two TextMate projects open, one in each display. When opening a file from the Terminal using the "mate" command in the project located in the secondary display TextMate will correctly open that file but set the focus on the project in the first display.
I'm not sure if this is a problem with TextMate or the OS X window management but it can be quite annoying.
On 6 Apr 2016, at 19:34, Jacob Carlborg wrote:
I have two displays. If I have two TextMate projects open, one in each display. When opening a file from the Terminal using the "mate" command in the project located in the secondary display TextMate will correctly open that file but set the focus on the project in the first display.
Instead of `mate` can you try open the file with `open -a TextMate /path/to/file` and see if that works better?
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]; }
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?
On 8 May 2016, at 20:44, Jacob Carlborg wrote:
Where would I put this code to try it out?
I have pushed the commit to master: https://github.com/textmate/textmate/commit/0ca13d8f2500e2abf12dd26f6a7d2765...
On 2016-05-08 23:29, Allan Odgaard wrote:
I have pushed the commit to master: https://github.com/textmate/textmate/commit/0ca13d8f2500e2abf12dd26f6a7d2765...
Thanks, I'll give it a try.
On 2016-05-08 23:29, Allan Odgaard wrote:
I have pushed the commit to master: https://github.com/textmate/textmate/commit/0ca13d8f2500e2abf12dd26f6a7d2765...
I tried the 2.0-beta.9.2 release now and so far the issue is resolved. Thanks :)
On 2016-04-06 14:34, Jacob Carlborg wrote:
I have two displays. If I have two TextMate projects open, one in each display. When opening a file from the Terminal using the "mate" command in the project located in the secondary display TextMate will correctly open that file but set the focus on the project in the first display.
I'm not sure if this is a problem with TextMate or the OS X window management but it can be quite annoying.
I have another slightly similar use case. I have two displays and two TextMate projects open in each display. I have the Terminal open in the second display. When I run "mate" to open the project in the first display TextMate now correctly sets focus on the project in the first display. But it also shows the project in the second display, covering the Terminal.
Is it possible to not show the project on the second display?
On 23 Jun 2016, at 10:16, Jacob Carlborg wrote:
I have another slightly similar use case. I have two displays and two TextMate projects open in each display. I have the Terminal open in the second display. When I run "mate" to open the project in the first display TextMate now correctly sets focus on the project in the first display. But it also shows the project in the second display, covering the Terminal.
Is it possible to not show the project on the second display?
I don’t think so. It seems to be a change in Apple’s activateIgnoringOtherApps: which now bring all windows to front.
Related issue: https://github.com/textmate/textmate/commit/59ef52b1f67d35cc549776ddf625f560...
When I run "mate" to open the project in the first display TextMate now correctly sets focus on the project in the first display. But it also shows the project in the second display, covering the Terminal.
Is it possible to not show the project on the second display?
Not sure this is remotely relevant, but it might be worth changing 'Displays have separate spaces' in Mission Control.
I have a colleague who was seeing some strange behaviour related to focusing, using multiple displays Unticking this option fixed his problems
Admittedly it's a bit of a long shot, but worth a try at least