Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top