diff options
author | dbj <dbj@pkgsrc.org> | 2015-04-23 06:47:56 +0000 |
---|---|---|
committer | dbj <dbj@pkgsrc.org> | 2015-04-23 06:47:56 +0000 |
commit | 78e28dcd2b05b143aaa51ad6fd586eafcfa4c890 (patch) | |
tree | 8c4768b281522478e697d75f561f07c94bcf60f1 /math | |
parent | af47ac3c6d6c3eca5b325f46bedfc7397e4d3412 (diff) | |
download | pkgsrc-78e28dcd2b05b143aaa51ad6fd586eafcfa4c890.tar.gz |
avoid obsolete darwin api for CGDisplayBitsPerPixel
use CGDisplayModeCopyPixelEncoding instead
Diffstat (limited to 'math')
-rw-r--r-- | math/octave/patches/patch-src_display.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/math/octave/patches/patch-src_display.cc b/math/octave/patches/patch-src_display.cc new file mode 100644 index 00000000000..fc7b0face54 --- /dev/null +++ b/math/octave/patches/patch-src_display.cc @@ -0,0 +1,25 @@ +$NetBSD: patch-src_display.cc,v 1.1 2015/04/23 06:47:56 dbj Exp $ + +CGDisplayBitsPerPixel is only good on osx 10.5 or earlier. +CGDisplayModeCopyPixelEncoding should work on 10.6 and later. + +--- src/display.cc.orig 2013-02-21 20:19:24.000000000 +0000 ++++ src/display.cc +@@ -72,7 +72,16 @@ display_info::init (bool query) + + if (display) + { +- dp = CGDisplayBitsPerPixel (display); ++ CGDisplayModeRef mode = CGDisplayCopyDisplayMode (display); ++ CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(mode); ++ CFRelease(mode); ++ if (CFStringCompare (pixelEncoding, CFSTR (IO32BitDirectPixels), 0) == 0) ++ dp = 32; ++ else if (CFStringCompare (pixelEncoding, CFSTR (IO16BitDirectPixels), 0) == 0) ++ dp = 16; ++ else ++ dp = 8; // Unknown pixel encoding (probably not really depth 8) ++ CFRelease(pixelEncoding); + + ht = CGDisplayPixelsHigh (display); + wd = CGDisplayPixelsWide (display); |