diff options
| author | Jan Djärv | 2015-05-15 16:21:59 +0200 |
|---|---|---|
| committer | Jan Djärv | 2015-05-15 16:23:44 +0200 |
| commit | e0e0753505cc2efefcee16bbed99ec6b9e5bcb39 (patch) | |
| tree | c34a9973a17919fe937ae5591c3d99c4e4a58ecb /src/nsfns.m | |
| parent | 2abfe21de9241aea36f7221184886b6b39f7648b (diff) | |
| download | emacs-e0e0753505cc2efefcee16bbed99ec6b9e5bcb39.tar.gz emacs-e0e0753505cc2efefcee16bbed99ec6b9e5bcb39.zip | |
Fix warnings on OSX 10.10.
* nsfns.m (MODAL_OK_RESPONSE): New define for different OSX versions.
(Fns_read_file_name): Check against MODAL_OK_RESPONSE.
(compute_tip_xy): Use convertRectToScreen for OSX >= 10.7
* nsmenu.m (initWithContentRect:styleMask:backing:defer:)
* nsimage.m (allocInitFromFile, setPixmapData): Only call
setScalesWhenResized for OSX < 10.6.
* nsterm.h (EmacsScroller): Declare scrollerWidth.
* nsterm.m (ns_copy_bits): New function that does not use deprecated
NSCopyBits.
(ns_scroll_run, ns_shift_glyphs_for_insert): Call ns_copy_bits.
(runAlertPanel): New function.
(applicationShouldTerminate:): Call runAlertPanel.
(initFrameFromEmacs, toggleFullScreen:): Only call useOptimizedDrawing
for OSX < 10.10.
(initFrameFromEmacs:): Only call allocateGState for OSX < 10.10.
(windowWillUseStandardFrame:defaultFrame:): Cast arg to abs to int.
(draggingEntered:): Returns NSDragOperation.
(scrollerWidth): Use scrollerWidthForControlSize for OSX >= 10.7.
Diffstat (limited to 'src/nsfns.m')
| -rw-r--r-- | src/nsfns.m | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index f8863e6d400..5f584e1c1bb 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1455,6 +1455,15 @@ ns_run_file_dialog (void) | |||
| 1455 | ns_fd_data.panel = nil; | 1455 | ns_fd_data.panel = nil; |
| 1456 | } | 1456 | } |
| 1457 | 1457 | ||
| 1458 | #ifdef NS_IMPL_COCOA | ||
| 1459 | #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9 | ||
| 1460 | #define MODAL_OK_RESPONSE NSModalResponseOK | ||
| 1461 | #endif | ||
| 1462 | #endif | ||
| 1463 | #ifndef MODAL_OK_RESPONSE | ||
| 1464 | #define MODAL_OK_RESPONSE NSOKButton | ||
| 1465 | #endif | ||
| 1466 | |||
| 1458 | DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 5, 0, | 1467 | DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 5, 0, |
| 1459 | doc: /* Use a graphical panel to read a file name, using prompt PROMPT. | 1468 | doc: /* Use a graphical panel to read a file name, using prompt PROMPT. |
| 1460 | Optional arg DIR, if non-nil, supplies a default directory. | 1469 | Optional arg DIR, if non-nil, supplies a default directory. |
| @@ -1549,7 +1558,7 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) | |||
| 1549 | while (ns_fd_data.panel != nil) | 1558 | while (ns_fd_data.panel != nil) |
| 1550 | [NSApp run]; | 1559 | [NSApp run]; |
| 1551 | 1560 | ||
| 1552 | ret = (ns_fd_data.ret == NSOKButton); | 1561 | ret = (ns_fd_data.ret == MODAL_OK_RESPONSE); |
| 1553 | 1562 | ||
| 1554 | if (ret) | 1563 | if (ret) |
| 1555 | { | 1564 | { |
| @@ -2677,7 +2686,16 @@ compute_tip_xy (struct frame *f, | |||
| 2677 | pt.y = dpyinfo->last_mouse_motion_y; | 2686 | pt.y = dpyinfo->last_mouse_motion_y; |
| 2678 | /* Convert to screen coordinates */ | 2687 | /* Convert to screen coordinates */ |
| 2679 | pt = [view convertPoint: pt toView: nil]; | 2688 | pt = [view convertPoint: pt toView: nil]; |
| 2689 | #if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | ||
| 2680 | pt = [[view window] convertBaseToScreen: pt]; | 2690 | pt = [[view window] convertBaseToScreen: pt]; |
| 2691 | #else | ||
| 2692 | { | ||
| 2693 | NSRect r = NSMakeRect (pt.x, pt.y, 0, 0); | ||
| 2694 | r = [[view window] convertRectToScreen: r]; | ||
| 2695 | pt.x = r.origin.x; | ||
| 2696 | pt.y = r.origin.y; | ||
| 2697 | } | ||
| 2698 | #endif | ||
| 2681 | } | 2699 | } |
| 2682 | else | 2700 | else |
| 2683 | { | 2701 | { |