Mercurial > emacs
changeset 77141:a2c0f9d173e8
[TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event):
Use GetGlobalMouse instead of GetMouse and LocalToGlobal.
(mac_initialize_display_info) [MAC_OSX]: Use CGRectZero.
(mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and
dpyinfo->width are those of whole screen.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Thu, 12 Apr 2007 08:11:27 +0000 |
parents | f9e6e90b6141 |
children | 1fbea0905278 |
files | src/macterm.c |
diffstat | 1 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/macterm.c Thu Apr 12 08:11:16 2007 +0000 +++ b/src/macterm.c Thu Apr 12 08:11:27 2007 +0000 @@ -10533,8 +10533,7 @@ { Point mouse_pos; - GetMouse (&mouse_pos); - LocalToGlobal (&mouse_pos); + GetGlobalMouse (&mouse_pos); err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint, sizeof (Point), &mouse_pos); } @@ -11554,7 +11553,7 @@ } if (err == noErr) { - CGRect bounds = CGRectMake (0, 0, 0, 0); + CGRect bounds = CGRectZero; while (ndisps-- > 0) bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps])); @@ -11569,15 +11568,21 @@ } #else { - GDHandle main_device_handle = LMGetMainDevice(); - - dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); + GDHandle gdh = GetMainDevice (); + Rect rect = (**gdh).gdRect; + + dpyinfo->color_p = TestDeviceAttribute (gdh, gdDevType); 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)) + if (HasDepth (gdh, dpyinfo->n_planes, gdDevType, dpyinfo->color_p)) break; - dpyinfo->height = (**main_device_handle).gdRect.bottom; - dpyinfo->width = (**main_device_handle).gdRect.right; + + for (gdh = GetDeviceList (); gdh; gdh = GetNextDevice (gdh)) + if (TestDeviceAttribute (gdh, screenDevice) + && TestDeviceAttribute (gdh, screenActive)) + UnionRect (&rect, &(**gdh).gdRect, &rect); + + dpyinfo->height = rect.bottom - rect.top; + dpyinfo->width = rect.right - rect.left; } #endif dpyinfo->grabbed = 0;