diff options
Diffstat (limited to 'src/macfns.c')
| -rw-r--r-- | src/macfns.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/macfns.c b/src/macfns.c index 3b09b344a55..88f975a65c8 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -312,6 +312,9 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *, | |||
| 312 | Lisp_Object, | 312 | Lisp_Object, |
| 313 | char *, char *, | 313 | char *, char *, |
| 314 | int)); | 314 | int)); |
| 315 | |||
| 316 | extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); | ||
| 317 | |||
| 315 | /* Store the screen positions of frame F into XPTR and YPTR. | 318 | /* Store the screen positions of frame F into XPTR and YPTR. |
| 316 | These are the positions of the containing window manager window, | 319 | These are the positions of the containing window manager window, |
| 317 | not Emacs's own window. */ | 320 | not Emacs's own window. */ |
| @@ -321,33 +324,15 @@ x_real_positions (f, xptr, yptr) | |||
| 321 | FRAME_PTR f; | 324 | FRAME_PTR f; |
| 322 | int *xptr, *yptr; | 325 | int *xptr, *yptr; |
| 323 | { | 326 | { |
| 324 | Point pt; | 327 | Rect inner, outer; |
| 325 | GrafPtr oldport; | ||
| 326 | 328 | ||
| 327 | GetPort (&oldport); | 329 | mac_get_window_bounds (f, &inner, &outer); |
| 328 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); | ||
| 329 | 330 | ||
| 330 | #if TARGET_API_MAC_CARBON | 331 | f->x_pixels_diff = inner.left - outer.left; |
| 331 | { | 332 | f->y_pixels_diff = inner.top - outer.top; |
| 332 | Rect r; | ||
| 333 | 333 | ||
| 334 | GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r); | 334 | *xptr = outer.left; |
| 335 | SetPt (&pt, r.left, r.top); | 335 | *yptr = outer.top; |
| 336 | } | ||
| 337 | #else /* not TARGET_API_MAC_CARBON */ | ||
| 338 | SetPt (&pt, | ||
| 339 | FRAME_MAC_WINDOW (f)->portRect.left, | ||
| 340 | FRAME_MAC_WINDOW (f)->portRect.top); | ||
| 341 | #endif /* not TARGET_API_MAC_CARBON */ | ||
| 342 | LocalToGlobal (&pt); | ||
| 343 | SetPort (oldport); | ||
| 344 | |||
| 345 | /* MAC has no frame pixel diff. */ | ||
| 346 | f->x_pixels_diff = 0; | ||
| 347 | f->y_pixels_diff = 0; | ||
| 348 | |||
| 349 | *xptr = pt.h; | ||
| 350 | *yptr = pt.v; | ||
| 351 | } | 336 | } |
| 352 | 337 | ||
| 353 | 338 | ||
| @@ -4262,6 +4247,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 4262 | NavUserAction userAction; | 4247 | NavUserAction userAction; |
| 4263 | CFStringRef message=NULL, client=NULL, saveName = NULL; | 4248 | CFStringRef message=NULL, client=NULL, saveName = NULL; |
| 4264 | 4249 | ||
| 4250 | BLOCK_INPUT; | ||
| 4265 | /* No need for a callback function because we are modal */ | 4251 | /* No need for a callback function because we are modal */ |
| 4266 | NavGetDefaultDialogCreationOptions(&options); | 4252 | NavGetDefaultDialogCreationOptions(&options); |
| 4267 | options.modality = kWindowModalityAppModal; | 4253 | options.modality = kWindowModalityAppModal; |
| @@ -4332,9 +4318,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 4332 | AEDisposeDesc(&defLocAed); | 4318 | AEDisposeDesc(&defLocAed); |
| 4333 | } | 4319 | } |
| 4334 | 4320 | ||
| 4335 | BLOCK_INPUT; | ||
| 4336 | status = NavDialogRun(dialogRef); | 4321 | status = NavDialogRun(dialogRef); |
| 4337 | UNBLOCK_INPUT; | ||
| 4338 | } | 4322 | } |
| 4339 | 4323 | ||
| 4340 | if (saveName) CFRelease(saveName); | 4324 | if (saveName) CFRelease(saveName); |
| @@ -4347,9 +4331,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 4347 | { | 4331 | { |
| 4348 | case kNavUserActionNone: | 4332 | case kNavUserActionNone: |
| 4349 | case kNavUserActionCancel: | 4333 | case kNavUserActionCancel: |
| 4350 | NavDialogDispose(dialogRef); | 4334 | break; /* Treat cancel like C-g */ |
| 4351 | Fsignal (Qquit, Qnil); /* Treat cancel like C-g */ | ||
| 4352 | return; | ||
| 4353 | case kNavUserActionOpen: | 4335 | case kNavUserActionOpen: |
| 4354 | case kNavUserActionChoose: | 4336 | case kNavUserActionChoose: |
| 4355 | case kNavUserActionSaveAs: | 4337 | case kNavUserActionSaveAs: |
| @@ -4384,6 +4366,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 4384 | dir, mustmatch, dir, Qfile_name_history, | 4366 | dir, mustmatch, dir, Qfile_name_history, |
| 4385 | default_filename, Qnil); | 4367 | default_filename, Qnil); |
| 4386 | } | 4368 | } |
| 4369 | UNBLOCK_INPUT; | ||
| 4387 | } | 4370 | } |
| 4388 | 4371 | ||
| 4389 | UNGCPRO; | 4372 | UNGCPRO; |