Question

I'm using a Macbook Pro Retina connected to a secondary non-retina display. How do I detect when my app is moved to the non-retina display?

EDIT: This is an OpenGL app. I'm using -backingScaleFactor in NSScreen to detect the scale factor of the screen. I'm looking for a way to detect when this changes.

Was it helpful?

Solution

NSWindow will post NSWindowDidChangeBackingPropertiesNotification. The window's delegate will receive -windowDidChangeBackingProperties: if it implements that method. A view will receive -viewDidChangeBackingProperties.

See the section "Handle Dynamic Changes in Window Resolution Only When You Must" in Apple's High Resolution Guidelines for OS X.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top