• 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: Panther's NSScreen vs. screen resolution changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Panther's NSScreen vs. screen resolution changes


  • Subject: Re: Panther's NSScreen vs. screen resolution changes
  • From: Peter Maurer <email@hidden>
  • Date: Wed, 16 Jun 2004 13:43:54 +0200

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.

I did listen to the NSApplicationDidChangeScreenParameters notification -- sort of. Actually, I used NSApplications's applicationDidChangeScreenParameters: delegate method, but this method wasn't ever called.

Turns out that my NSApplication subclass's sendEvent: method was eating NSSystemDefined events. Now that I'm sending these to super, everything is fine again. Thanks for your help,

Peter Maurer.
_______________________________________________
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.


References: 
 >Panther's NSScreen vs. screen resolution changes (From: Peter Maurer <email@hidden>)
 >Re: Panther's NSScreen vs. screen resolution changes (From: Shaun Wexler <email@hidden>)

  • Prev by Date: Re: [newbie] numeric strings
  • Next by Date: Re: Defining a constant as private
  • Previous by thread: Re: Panther's NSScreen vs. screen resolution changes
  • Next by thread: Re: Panther's NSScreen vs. screen resolution changes
  • Index(es):
    • Date
    • Thread