From b51065cf2ed0fdb80719fab58c77c74ec405fbcb Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 26 Mar 2007 08:13:45 +0000 Subject: [PATCH] (create_text_encoding_info_alist): Move assignments outside predicate macros. (mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and dpyinfo->width are those of whole screen. --- src/ChangeLog | 14 ++++++++++++++ src/macterm.c | 37 ++++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e44c5197204..3469a14d153 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2007-03-26 YAMAMOTO Mitsuharu + + * macfns.c (Fx_display_mm_height, Fx_display_mm_width): Scale + whole screen size in pixels by millimeters per pixel of main display. + + * macselect.c (get_scrap_target_type_list, x_own_selection): Move + assignments outside predicate macros. + (Vselection_converter_alist): Doc fix. + + * macterm.c (create_text_encoding_info_alist): Move assignments + outside predicate macros. + (mac_initialize_display_info) [MAC_OSX]: dpyinfo->height and + dpyinfo->width are those of whole screen. + 2007-03-26 Sam Steingold * process.c (sigchld_handler): Delay by 1ms instead of 1s to diff --git a/src/macterm.c b/src/macterm.c index a5a193cb88c..e377d352476 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -7172,11 +7172,14 @@ create_text_encoding_info_alist () 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); @@ -11538,8 +11541,32 @@ mac_initialize_display_info () 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(); -- 2.39.5