0

I'm facing issues with supporting retina screens with my Safari NPAPI plugin.

I'm using a CoreGraphics based plugin and for some reason the backingScaleFactor returned by the windows I'm using is 1 instead of 2 on a retina screen.

I tried to look for some config parameters with no luck.

The only way I could make it to work, is by creating a subclass of NSWindow and overriding backingScaleFactor to return 2. However, I couldn't find a way to detect retina screens from the plugin itself.

Any thoughts?

Samir
  • 627
  • 4
  • 9

2 Answers2

0

Unfortunately, there probably isn't a way. You can't get the NSWindow you're using, so there is no way to be sure which monitor you are drawing on. If Safari doesn't give you what you need, there probably isn't an option.

taxilian
  • 14,229
  • 4
  • 34
  • 73
0

However, I couldn't find a way to detect retina screens from the plugin itself.

You can query this information, and get updates when it changes, using NPNVcontentsScaleFactor.

smorgan
  • 20,228
  • 3
  • 47
  • 55
  • Querying NPNVcontentsScaleFactor gives me always 1 with Safari. I'm doing it using the following: "boost::shared_ptr npapihost = FB::ptr_cast(m_host); double contentsScaleFactor = 1.0; npapihost->GetValue(NPNVcontentsScaleFactor, &contentsScaleFactor); Any thoughts? – Samir Nov 06 '14 at 14:45