aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2004-06-17 13:04:25 +0000
committerJan Djärv2004-06-17 13:04:25 +0000
commitf303762dc1885b861fe9e9a9a6a5ec618c23ef31 (patch)
tree868dc5f2af29c2dae95f60d1d5e74750e8de8d17 /src
parent1891f34803c8ff687d5f1e48b5a00af2b4b55bfb (diff)
downloademacs-f303762dc1885b861fe9e9a9a6a5ec618c23ef31.tar.gz
emacs-f303762dc1885b861fe9e9a9a6a5ec618c23ef31.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/macfns.c4
-rw-r--r--src/macterm.c6
3 files changed, 15 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 746bd991049..15cd195b4ed 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12004-06-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
4
5 * macterm.c (mac_initialize_display_info): Initialize n_planes correctly
6 on Mac OSX.
7
12004-06-16 Luc Teirlinck <teirllm@auburn.edu> 82004-06-16 Luc Teirlinck <teirllm@auburn.edu>
2 9
3 * buffer.c (syms_of_buffer): Clarify `fill-column' docstring. 10 * buffer.c (syms_of_buffer): Clarify `fill-column' docstring.
diff --git a/src/macfns.c b/src/macfns.c
index 5c1b7770640..ec014e772e3 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2939,8 +2939,8 @@ If omitted or nil, that stands for the selected frame's display. */)
2939{ 2939{
2940 struct mac_display_info *dpyinfo = check_x_display_info (display); 2940 struct mac_display_info *dpyinfo = check_x_display_info (display);
2941 2941
2942 /* MAC_TODO: check whether this is right */ 2942 /* We force 24+ bit depths to 24-bit to prevent an overflow. */
2943 return make_number (dpyinfo->n_planes >= 8 ? 256 : 1 << dpyinfo->n_planes - 1); 2943 return make_number (1 << min (dpyinfo->n_planes, 24));
2944} 2944}
2945 2945
2946DEFUN ("x-server-max-request-size", Fx_server_max_request_size, 2946DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
diff --git a/src/macterm.c b/src/macterm.c
index 54a2fce792d..55ae1b35d83 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -8840,10 +8840,16 @@ mac_initialize_display_info ()
8840 dpyinfo->resx = 75.0; 8840 dpyinfo->resx = 75.0;
8841 dpyinfo->resy = 75.0; 8841 dpyinfo->resy = 75.0;
8842 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); 8842 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
8843#ifdef MAC_OSX
8844 /* HasDepth returns true if it is possible to have a 32 bit display,
8845 but this may not be what is actually used. Mac OSX can do better. */
8846 dpyinfo->n_planes = CGDisplayBitsPerPixel (CGMainDisplayID ());
8847#else
8843 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) 8848 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1)
8844 if (HasDepth (main_device_handle, dpyinfo->n_planes, 8849 if (HasDepth (main_device_handle, dpyinfo->n_planes,
8845 gdDevType, dpyinfo->color_p)) 8850 gdDevType, dpyinfo->color_p))
8846 break; 8851 break;
8852#endif
8847 dpyinfo->height = (**main_device_handle).gdRect.bottom; 8853 dpyinfo->height = (**main_device_handle).gdRect.bottom;
8848 dpyinfo->width = (**main_device_handle).gdRect.right; 8854 dpyinfo->width = (**main_device_handle).gdRect.right;
8849 dpyinfo->grabbed = 0; 8855 dpyinfo->grabbed = 0;