Re: Trouble centering window after mode switch (solved)
Re: Trouble centering window after mode switch (solved)
- Subject: Re: Trouble centering window after mode switch (solved)
- From: Ricky Sharp <email@hidden>
- Date: Wed, 31 Jan 2007 09:12:49 -0800
On Wednesday, January 31, 2007, at 01:50AM, "Matt R" <email@hidden> wrote:
>Now the problem is just finding a non-display-capture alternative to take
>over the screen. I've experimented with putting a backdrop window at
>shielding level to block out the screen, and then having the smaller main
>windows float ontop of that at shielding level also. Now my problem is
>trying to prevent users from bringing the backdrop window to the front. I
>overrode the custom window's MouseDown event and did [NSApp
>preventWindowOrdering], but it doesn't seem to work. Only solution is if I
>add [backdropWindow orderBack:nil] which seems a hackish way of doing things
>and at certain times causes a flicker to occur as the windows quickly swap.
>Just seems like a bad idea. I thought of overriding NSApp's sendEvent method
>to completely block out any mouseclick events sent to the backdrop window,
>but that seems like overkill. But I can't seem to get [NSApp
>preventWindowOrdering] to work and there seems to be no flag or BOOL value
>to tell AppKit not to let the window get ordered in front when clicked. I'm
>actually kind of stumped at this point :[
What I do for my full-screen apps are:
(1) early in app-starup (I do this in applicationDidFinishLaunching:), call SetSystemUIMode (you'll need to link to Carbon.framework). There's a very good technote from Apple on that API and what it's params allow you to configure.
(2) For all screens, I create a full-screen 'blanking window'. I think I put this in the floating window level. I know I do _not_ use CG's shielding window level.
(3) For the screen the user wants content on, I put up my 'content window'. I make this window a child of that particular screen's blanking window. See NSWindow docs for child window APIs.
(4) My content window is a custom subclass of NSWindow; so are instances of my blanking window. I did this because both are borderless and I needed to set up many other attributes. For example, my blanking windows can never become main or key. I also set them up to hide if the application is ever deactivated (only occurs when I click on a hyperlink in my about box which opens that URL in the user's preferred browser).
The behaviors I get are as follows:
* Expose does nothing (which I like)
* Clicking on a blanking window does nothing (never comes to the front as the content window is a child)
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden