diff src/macterm.c @ 56146:5e784b2ea638

* macfns.c (Fx_display_color_cells): Do not limit return value to 256. * macterm.c (mac_initialize_display_info): Initialize n_planes correctly on Mac OSX.
author Jan Dj?rv <jan.h.d@swipnet.se>
date Thu, 17 Jun 2004 13:04:25 +0000
parents f1d6a507dcfd
children 98f2b9da67f0 dbcd0af66869 4c90ffeb71c5
line wrap: on
line diff
--- a/src/macterm.c	Thu Jun 17 08:33:27 2004 +0000
+++ b/src/macterm.c	Thu Jun 17 13:04:25 2004 +0000
@@ -8840,10 +8840,16 @@
   dpyinfo->resx = 75.0;
   dpyinfo->resy = 75.0;
   dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
+#ifdef MAC_OSX
+  /* HasDepth returns true if it is possible to have a 32 bit display,
+     but this may not be what is actually used.  Mac OSX can do better.  */
+  dpyinfo->n_planes = CGDisplayBitsPerPixel (CGMainDisplayID ());
+#else
   for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1)
     if (HasDepth (main_device_handle, dpyinfo->n_planes,
 		  gdDevType, dpyinfo->color_p))
       break;
+#endif
   dpyinfo->height = (**main_device_handle).gdRect.bottom;
   dpyinfo->width = (**main_device_handle).gdRect.right;
   dpyinfo->grabbed = 0;