Re: Panther's NSScreen vs. screen resolution changes
Re: Panther's NSScreen vs. screen resolution changes
- Subject: Re: Panther's NSScreen vs. screen resolution changes
- From: Shaun Wexler <email@hidden>
- Date: Tue, 8 Jun 2004 13:17:59 -0700
On Jun 8, 2004, at 6:01 AM, Peter Maurer wrote:
Hi group,
has anyone ever noticed that Panther's NSScreen class doesn't seem to
perceive screen resolution changes while an application is running? I
always have to restart my application to make [[[NSScreen screens]
objectAtIndex: 0] frame] return the actual screen size after changing
the screen resolution. I've never had this problem with Jaguar.
Could this be due to excessive caching, or is it just me?
You should listen for
NSApplicationDidChangeScreenParametersNotification or
NSWindowDidChangeScreensNotification (in your NSWindow delegate), and
use either of those to refresh your list of NSScreen objects. They're
both triggered by the same event. I think that this behavior is a big
hairy bug, and that this notification (name?) is misleading, redundant,
and it would be more useful if it actually did what it says: notified
when a window frame has moved onto a different screen's frame. If
that's the type of notification you need, you have to listen for
NSWindowDidMoveNotification (which are coalesced, thankfully), and
compare the current NSScreen to the cached previous screen for your
window.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.