Mercurial > emacs
diff src/macterm.c @ 90796:4ef881a120fe
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 675-697)
- Update from CVS
- Merge from gnus--rel--5.10
- Release ERC 5.2.
* gnus--rel--5.10 (patch 211-215)
- Update from CVS
- Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-189
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 11 Apr 2007 00:17:47 +0000 |
parents | c0409ee15cee d3898ad6d0d5 |
children | e6fdae9180d4 |
line wrap: on
line diff
--- a/src/macterm.c Fri Mar 30 02:06:58 2007 +0000 +++ b/src/macterm.c Wed Apr 11 00:17:47 2007 +0000 @@ -7191,11 +7191,14 @@ Lisp_Object existing_info; if (!(CONSP (charset_info) - && STRINGP (charset = XCAR (charset_info)) + && (charset = XCAR (charset_info), + STRINGP (charset)) && CONSP (XCDR (charset_info)) - && INTEGERP (text_encoding = XCAR (XCDR (charset_info))) + && (text_encoding = XCAR (XCDR (charset_info)), + INTEGERP (text_encoding)) && CONSP (XCDR (XCDR (charset_info))) - && SYMBOLP (coding_system = XCAR (XCDR (XCDR (charset_info)))))) + && (coding_system = XCAR (XCDR (XCDR (charset_info))), + SYMBOLP (coding_system)))) continue; existing_info = assq_no_quit (text_encoding, result); @@ -11535,8 +11538,32 @@ but this may not be what is actually used. Mac OSX can do better. */ dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1; dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay); - dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); - dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); + { + CGDisplayErr err; + CGDisplayCount ndisps; + CGDirectDisplayID *displays; + + err = CGGetActiveDisplayList (0, NULL, &ndisps); + if (err == noErr) + { + displays = alloca (sizeof (CGDirectDisplayID) * ndisps); + err = CGGetActiveDisplayList (ndisps, displays, &ndisps); + } + if (err == noErr) + { + CGRect bounds = CGRectMake (0, 0, 0, 0); + + while (ndisps-- > 0) + bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps])); + dpyinfo->height = CGRectGetHeight (bounds); + dpyinfo->width = CGRectGetWidth (bounds); + } + else + { + dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); + dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); + } + } #else { GDHandle main_device_handle = LMGetMainDevice();