Mac OS can't bring window into focus

Hi all,

Can anyone think of a solution or work around for this?

//

w = Window.new(“GUI w”, Rect(200,200,255,100));
w.front;

y = Window.new(“GUI y”, Rect(400,400,255,100));
y.front;

// only y comes into focus with the following

w.front;
y.front;
w.front;

//

I am on various macs and a few versions of SC so I think its a Mac specific GUI issue.

I want to use keystrokes or a midi controller to bring different windows into focus.

The only work around I have come up with so far is to us ( cmd ` ) to cycle through the Quartz windows. This is ok but I would rather be able to specify which window I bring into focus than just cycle through them.

Many thanks

Simon

Ahh a bit of searching and found this.

This seems wierd but works. Thanks Fred from the past!

w = Window.new(“GUI w”, Rect(200,200,255,100));
w.front;

y = Window.new(“GUI y”, Rect(400,400,255,100));
y.front;

// only y comes into focus with the following

w.front;
y.front;
w.front;

w.front;
w.alwaysOnTop_(true);
w.alwaysOnTop_(false);

y.front;
y.alwaysOnTop_(true);
y.alwaysOnTop_(false);

1 Like

Hi @simon !

I recently wrote about this in another thread: GUI: Window .front
I hope this helps!

2 Likes

Thank MarcinP

Got a good work around with this now…

w = Window.new(“GUI w”, Rect(200,200,255,100));
w.front;

y = Window.new(“GUI y”, Rect(400,400,255,100));
y.front;

// only y comes into focus with the following

w.front;
y.front;
w.front;

// for some reason this sorts it out
w.front;
w.alwaysOnTop_(true);
w.alwaysOnTop_(false);

y.front;
y.alwaysOnTop_(true);
y.alwaysOnTop_(false);