Re: Window levels - is this safe?
Re: Window levels - is this safe?
- Subject: Re: Window levels - is this safe?
- From: Keith Blount <email@hidden>
- Date: Wed, 26 Jul 2006 06:13:24 -0700 (PDT)
Many thanks for your reply - much appreciated. I think
your suggestion may well be the way to go. Full screen
in my app is supposed to be a "no distractions" mode,
so blocking application switching and Expose may
actually be a bonus rather than a problem.
My only problem now is that I do not have access to a
dual- or multi-screen set up for the time being, so
although I can have a go at coding the blanking
screens, I'll have to rely on my beta testers to tell
me whether or not it works. :) My plan is to create
the blanking windows in the -showWindow: code of my
main window, and then add the main window as s child,
and get rid of all the blanking windows in the -close
method. I can then monitor for
NSApplicationDidChangeScreenParametersNotification and
update the blanking windows as necessary. Does that
sound about right?
Many thanks again,
Keith
P.S. My app is Tiger-only, so I won't be worried about
backwards-compatibility until Leopard.
--- Ricky Sharp <email@hidden> wrote:
>
> On Wednesday, July 26, 2006, at 04:53AM, Keith
> Blount <email@hidden> wrote:
>
> >Thanks for the reply. Unfortunately, the
> >CGShieldingWindowLevel has an even higher priority
> >than a floating panel, so using this suppresses all
> of
> >my floating panels.
>
> And be advised that using levels like this is a bit
> tricky. Definitely search the archives for pitfalls
> on using CGShieldingWindowLevel with apps that need
> to present standard UI.
>
> >In fact, it turns out my earlier solution is no
> good
> >either. It works fine for the most part, but then
> if
> >you try to show a normal window over the window -
> such
> >as the Preferences window or a find panel - they
> will
> >be hidden, because the full screen window's level
> is
> >set higher than a normal window (of course).
> >
> >I'm finding the whole thing rather tricky. I just
> want
> >my full screen window to play nice with Expose and
> >other apps, but everything I try has some small
> >problem. The behaviour I would like is this:
> >
> >- In full screen, the full screen window should
> allow
> >other application windows in front of it _except_
> for
> >document windows. In other words, preference panels
> >etc should be allowed, but not the main window. The
> >main window, however, should be visible beneath the
> >full screen window, which can be translucent.
> >- In expose, during full screen, only the main
> >document window should be visible (not the full
> screen
> >window). Clicking on it will return to full screen
> >mode though.
> >- Ditto when switching between apps: only the main
> >window should be visible. Clicking on it should
> return
> >to full screen, though.
> >
> >I could live with it for now if I had to end full
> >screen mode when the application deactivated.
> However,
> >I've tried that, and it turns out that running
> expose
> >whilst my app is active does not deactivate my app,
> >meaning that the full screen window does not close,
> >meaning that it is visible in Expose along with the
> >normal window...
> >
> >If anybody has any ideas about how I can handle
> this
> >gracefully, I would be very grateful.
>
> The first question to ask is if you definitely want
> to have your app work with Expose. For my
> full-screen apps, I do this:
>
> * SetSystemUIMode to supress menu bar and dock
> * Put up blanking (shielding) windows on all
> screens. These are NSWindow subclasses where I set
> up all appropriate attributes (e.g. they can never
> become key or main)
> * Put up a content window on the desired screen.
> This window is made as a child of a particular
> blanking window; thus preventing the blanking window
> from ever becoming frontmost.
>
> The result is that users are not able to switch to
> other apps or invoke any modes of Expose. But this
> is a good thing for certain apps (think games,
> kiosks, etc.).
>
> Having said all that, in the Carbon flavor of my
> app, I was able to have it be a good Expose citizen
> in that Expose could be invoked and I got it where
> only my content window was displayed amongst the
> windows that were moved/tiled/etc. Blanking windows
> always were hidden. If you do want your Cocoa app
> to behave in the same manner, you may be able to
> duplicate this. I believe I did it by setting up
> window levels as well as using SetSystemUIMode.
>
> One thing though that you'll definitely need to
> check is how your app works on various OS versions
> (not sure what minimum OS you want to work with). I
> seem to remember that the behavior of full-screen
> apps did change between OS versions as bugs were
> fixed. It could thus be the case that invoking
> SetSystemUIMode with certain options will always
> prevent Expose from being invoked. Not sure.
>
> --
> Rick Sharp
> Instant Interactive(tm)
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.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