Re: Preventing mouse clicks from bringing a window to the front
Re: Preventing mouse clicks from bringing a window to the front
- Subject: Re: Preventing mouse clicks from bringing a window to the front
- From: Ricky Sharp <email@hidden>
- Date: Sat, 19 Feb 2005 10:19:11 -0600
On Feb 19, 2005, at 9:32 AM, Ricky Sharp wrote:
On Feb 18, 2005, at 6:09 PM, Tim Hewett wrote:
I **think** you can do this by making one of the windows a
child of the other and then defining how they are to be ordered.
So you could set your "always behind" window to be a child
of the "always front" one and it should then keep that ordering
even when clicked.
This is definitely worth looking at. The problem I have with using
the window levels is that it banks on the fact that there are several
values between the level constants (i.e. an implementation detail).
For example, the "distance" between NSNormalWindowLevel and
NSFloatingWindowLevel is more than at least 2 (don't recall the actual
number offhand). In my app, I also put windows (e.g. custom help
tags) at NSFloatingWindowLevel and thankfully they are above my main
windows.
In asking Apple engineers if this implementation detail would ever
change, they said no, but didn't rule it out completely.
Hopefully this weekend I'll give Tim's suggestion a whirl. Will post
the results.
Results are good. I removed the code that set the window levels and
added this instead in my app startup logic:
[theMainBlankingWindow addChildWindow:theContentWindow
ordered:NSWindowAbove];
Here, theMainBlankingWindow is the blanking window on the main screen
(i.e. window that covers the screen returned by [NSScreen mainScreen]).
Note that my blanking windows still override canBecomeKeyWindow and
canBecomeMainWindow. Both return NO. Even if I didn't provide the
override, the blanking (parent window in this case) doesn't have a
title bar, so will by default not become key or main.
Expose does work reasonably well. Invoking F9 or F10 will move both
parent and child windows as a single unit. Clicking on either will
return control to your app and leave the windows in the proper order.
If there was a method to mark a window as being ignored by Expose, I'd
mark the parent (blanking) window. This, IMO, would provide the best
experience with Expose.
Also verified that my content window remained the key and main window
at all times. Clicks to the parent window are ultimately ignored.
This setup is much better, IMO, than the window level solution.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden