aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
authorJan Djärv2004-07-05 07:01:02 +0000
committerJan Djärv2004-07-05 07:01:02 +0000
commit2bac9bb1c6432dc52b16970d94f207c6dc500ed5 (patch)
treede7027c0b0d5266802777a1d9c1f8ceef432b8b5 /src/macterm.c
parent1f724d55e96643fb770cbb4f9e8f4412098f3ae5 (diff)
downloademacs-2bac9bb1c6432dc52b16970d94f207c6dc500ed5.tar.gz
emacs-2bac9bb1c6432dc52b16970d94f207c6dc500ed5.zip
* macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
instead of CGMainDisplayID (only in OSX 10.2 and later).
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/macterm.c b/src/macterm.c
index a5146dc8ec4..7d9c2bf7105 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -8854,8 +8854,21 @@ mac_initialize_display_info ()
8854 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); 8854 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
8855#ifdef MAC_OSX 8855#ifdef MAC_OSX
8856 /* HasDepth returns true if it is possible to have a 32 bit display, 8856 /* HasDepth returns true if it is possible to have a 32 bit display,
8857 but this may not be what is actually used. Mac OSX can do better. */ 8857 but this may not be what is actually used. Mac OSX can do better.
8858 dpyinfo->n_planes = CGDisplayBitsPerPixel (CGMainDisplayID ()); 8858 CGMainDisplayID is only available on OSX 10.2 and higher, but the
8859 header for CGGetActiveDisplayList says that the first display returned
8860 is the active one, so we use that. */
8861 {
8862 CGDirectDisplayID disp_id[1];
8863 CGDisplayCount disp_count;
8864 CGDisplayErr error_code;
8865
8866 error_code = CGGetActiveDisplayList (1, disp_id, &disp_count);
8867 if (error_code != 0)
8868 error ("No display found, CGGetActiveDisplayList error %d", error_code);
8869
8870 dpyinfo->n_planes = CGDisplayBitsPerPixel (disp_id[0]);
8871 }
8859#else 8872#else
8860 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) 8873 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1)
8861 if (HasDepth (main_device_handle, dpyinfo->n_planes, 8874 if (HasDepth (main_device_handle, dpyinfo->n_planes,