Mercurial > emacs
diff src/macfns.c @ 57357:05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
(x_real_positions): Use mac_get_window_bounds.
macmenu.c (update_submenu_strings): Apply 2004-09-07 change for
xmenu.c (YAILOM).
macterm.c [!MAC_OSX]: Include Windows.h.
(front_emacs_window): Rename from mac_front_window. All uses
changed. Return the frontmost non-tooltip emacs window.
(mac_get_window_bounds): New function.
(x_calc_absolute_position): Use the difference of width and height
between the inner and outer window.
(x_set_offset): Specify window position by the coordinae of the
outer window. Adjust the position if the title bar is completely
outside the screen.
(app_is_suspended, app_sleep_time): Remove unused variables.
(do_app_resume, do_app_suspend): Remove their contents because
window-activate/deactivate events will do the job.
(do_zoom_window): Remove unused variables. Make compliant to the
standard way of zooming. Set f->left_pos and f->top_pos.
(XTread_socket): Don't use argument `expected'. Don't use
FrontWindow to determine the clicked window. Exclude unprocessed
mouseUp cases in the early stage. Add parentheses to fix operator
precedence.
(XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area.
author | Steven Tamm <steventamm@mac.com> |
---|---|
date | Wed, 06 Oct 2004 15:38:53 +0000 |
parents | a81166121d93 |
children | 0867872551d9 |
line wrap: on
line diff
--- a/src/macfns.c Wed Oct 06 13:27:03 2004 +0000 +++ b/src/macfns.c Wed Oct 06 15:38:53 2004 +0000 @@ -312,6 +312,9 @@ Lisp_Object, char *, char *, int)); + +extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); + /* Store the screen positions of frame F into XPTR and YPTR. These are the positions of the containing window manager window, not Emacs's own window. */ @@ -321,33 +324,15 @@ FRAME_PTR f; int *xptr, *yptr; { - Point pt; - GrafPtr oldport; - - GetPort (&oldport); - SetPortWindowPort (FRAME_MAC_WINDOW (f)); - -#if TARGET_API_MAC_CARBON - { - Rect r; - - GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r); - SetPt (&pt, r.left, r.top); - } -#else /* not TARGET_API_MAC_CARBON */ - SetPt (&pt, - FRAME_MAC_WINDOW (f)->portRect.left, - FRAME_MAC_WINDOW (f)->portRect.top); -#endif /* not TARGET_API_MAC_CARBON */ - LocalToGlobal (&pt); - SetPort (oldport); - - /* MAC has no frame pixel diff. */ - f->x_pixels_diff = 0; - f->y_pixels_diff = 0; - - *xptr = pt.h; - *yptr = pt.v; + Rect inner, outer; + + mac_get_window_bounds (f, &inner, &outer); + + f->x_pixels_diff = inner.left - outer.left; + f->y_pixels_diff = inner.top - outer.top; + + *xptr = outer.left; + *yptr = outer.top; }