• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Window levels - is this safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window levels - is this safe?


  • Subject: Re: Window levels - is this safe?
  • From: Keith Blount <email@hidden>
  • Date: Wed, 26 Jul 2006 02:53:35 -0700 (PDT)

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.

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.

Thanks again,
Keith

---------
FROM : Michael Watson
DATE : Wed Jul 26 09:56:40 2006

Look into SetSystemUIMode:

http://developer.apple.com/technotes/tn2002/tn2062.html

The shielding window level can be obtained via
CGShieldingWindowLevel
() and used with NSWindow's -setLevel: method, but
I've been told
there may be a more future-proof way of accomplishing
this part of
the task.


--
Michael Watson

On 26 Jul, 2006, at 03:50, Keith Blount wrote:

> Hello,
>
> My app can launch into full screen and I have been
> having some problems getting the behaviour I want
> between application switching and expose in this
mode.
>
> My problem is that while in full screen, if the user
> switches to expose, as in iPhoto, he or she should
see
> the window's main window, not the full screen
window,
> but clicking on it should bring back up the full
> screen window. Switching between applications should
> hide the full screen window, but clicking back on
the
> main window when switching back to my app should
bring
> up full screen again. This is all pretty much
standard
> full screen behaviour, but achieving it is a little
> more difficult than it first seems.
>
> I found that I could get most of the behaviour I
want
> like this:
>
> [fsWindow setFloatingPanel:YES]; // fsWindow is
> actually an NSPanel subclass
> [fsWindow setHidesOnDeactivate:YES];
>
> That hides the full screen window from expose, plays
> nicely with other apps, and would, for most full
> screen modes, be fine. However, my full screen
window
> has several other floating panels that can appear
over
> the top of it. Using this code means that if my full
> screen window gets clicked, the other floating
panels
> disappear behind it.
>
> I eventually figured out that what I wanted was
> something between normal window level and floatig
> window level, so, seeing that there seems to be no
> such level defined, tried both of the following:
>
> [fsWindow setLevel:NSFloatingWindowLevel-1];
>
> and
>
> [fsWindow setLevel:NSNormalWindowLevel+1];
>
> It turns out that either of these work perfectly
fine,
> and get the exact behaviour I want - my full screen
> window is now hidden from expose but doesn't obscure
> other floating panels, and it plays well with other
> apps.
>
> But how safe is using an undefined window level like
> this? I'm sure that the answer is, it's safe until
> Apple decide to use that window level for something
> else, so my real question then would be, is there a
> better way of going about what I want to achieve?
>
> Many thanks in advance,
> Keith

__________________________________________________
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

  • Follow-Ups:
    • Re: Window levels - is this safe?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Dragging window when modifier keys pressed.
  • Next by Date: cursorRects/trackingRects in non-key window
  • Previous by thread: Re: Window levels - is this safe?
  • Next by thread: Re: Window levels - is this safe?
  • Index(es):
    • Date
    • Thread