diff options
| author | Kenichi Handa | 2012-10-07 21:58:14 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-10-07 21:58:14 +0900 |
| commit | dade5fca51ce2ed10fdace1cfcf78287599154a1 (patch) | |
| tree | 299c84e1ce2c5a95237b41781113790626d259c5 /src | |
| parent | 6aa75fb62f6cdc4164d935ef14d57feec5ed6e0a (diff) | |
| parent | 78d876b90e52400b7bbb086ca1a471d3d20d0e98 (diff) | |
| download | emacs-dade5fca51ce2ed10fdace1cfcf78287599154a1.tar.gz emacs-dade5fca51ce2ed10fdace1cfcf78287599154a1.zip | |
merge trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 62 | ||||
| -rw-r--r-- | src/nsfns.m | 47 | ||||
| -rw-r--r-- | src/nsimage.m | 8 | ||||
| -rw-r--r-- | src/nsmenu.m | 5 | ||||
| -rw-r--r-- | src/nsselect.m | 4 | ||||
| -rw-r--r-- | src/nsterm.h | 16 | ||||
| -rw-r--r-- | src/nsterm.m | 232 | ||||
| -rw-r--r-- | src/sysdep.c | 18 | ||||
| -rw-r--r-- | src/syssignal.h | 2 |
9 files changed, 182 insertions, 212 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 956e78e6c7e..492b966a256 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,65 @@ | |||
| 1 | 2012-10-07 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsterm.m (ns_dumpglyphs_image): Only draw slize of image (Bug#12506). | ||
| 4 | |||
| 5 | * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of | ||
| 6 | MAC_OS_X_VERSION_10_6. | ||
| 7 | (syms_of_nsterm): Remove comment about Panther and above for ns-antialias-text. | ||
| 8 | * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove. | ||
| 9 | (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4. | ||
| 10 | (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3. | ||
| 11 | |||
| 12 | * nsselect.m (ns_string_from_pasteboard): Remove check for >= | ||
| 13 | MAC_OS_X_VERSION_10_4. | ||
| 14 | |||
| 15 | * nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2. | ||
| 16 | |||
| 17 | * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger. | ||
| 18 | |||
| 19 | * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4. | ||
| 20 | (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4. | ||
| 21 | |||
| 22 | * nsterm.m (ns_in_resize): Remove (Bug#12479). | ||
| 23 | (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove. | ||
| 24 | (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize | ||
| 25 | check. | ||
| 26 | (ns_clear_frame_area): Remove resize handle code. | ||
| 27 | |||
| 28 | * nsfns.m (ns_in_resize): Remove. | ||
| 29 | (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove ns_in_resize | ||
| 30 | check. | ||
| 31 | |||
| 32 | 2012-10-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 33 | |||
| 34 | Improve sys_siglist detection. | ||
| 35 | * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's | ||
| 36 | defined as a macro, as is done in Solaris. | ||
| 37 | (sys_siglist_entries): New macro. | ||
| 38 | (save_strsignal): Use it. | ||
| 39 | * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify | ||
| 40 | GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection. | ||
| 41 | |||
| 42 | 2012-10-06 Jan Djärv <jan.h.d@swipnet.se> | ||
| 43 | |||
| 44 | * nsfns.m (Fx_create_frame): Call x_default_parameter with | ||
| 45 | fullscreen/Fullscreen. | ||
| 46 | |||
| 47 | * nsterm.h (EmacsView): Rename tbar_height to tibar_height. | ||
| 48 | tobar_height is new. | ||
| 49 | |||
| 50 | * nsterm.m (x_make_frame_visible): Check for fullscreen. | ||
| 51 | (ns_fullscreen_hook): Activate old style fullscreen with a timer. | ||
| 52 | (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen. | ||
| 53 | (windowDidResize:): Check for correct window if old style fullscreen. | ||
| 54 | Capitalize word in comment. Remove incorrect comment. | ||
| 55 | (initFrameFromEmacs:): tbar_height renamed tibar_height. | ||
| 56 | (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix | ||
| 57 | error in drawing background. | ||
| 58 | (toggleFullScreen:): Remove comment. Rearrange calls. | ||
| 59 | Set toolbar values to zero, save old height in tobar_height. | ||
| 60 | Restore tool bar height when leaving fullscreen. | ||
| 61 | (canBecomeMainWindow): New function. | ||
| 62 | |||
| 1 | 2012-10-06 Paul Eggert <eggert@cs.ucla.edu> | 63 | 2012-10-06 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 64 | ||
| 3 | * keyboard.c (read_char): Remove unnecessary 'volatile's and label. | 65 | * keyboard.c (read_char): Remove unnecessary 'volatile's and label. |
diff --git a/src/nsfns.m b/src/nsfns.m index 1efadf0cb98..7a22ac547c3 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -93,8 +93,6 @@ EmacsTooltip *ns_tooltip; | |||
| 93 | /* Need forward declaration here to preserve organizational integrity of file */ | 93 | /* Need forward declaration here to preserve organizational integrity of file */ |
| 94 | Lisp_Object Fx_open_connection (Lisp_Object, Lisp_Object, Lisp_Object); | 94 | Lisp_Object Fx_open_connection (Lisp_Object, Lisp_Object, Lisp_Object); |
| 95 | 95 | ||
| 96 | extern BOOL ns_in_resize; | ||
| 97 | |||
| 98 | /* Static variables to handle applescript execution. */ | 96 | /* Static variables to handle applescript execution. */ |
| 99 | static Lisp_Object as_script, *as_result; | 97 | static Lisp_Object as_script, *as_result; |
| 100 | static int as_status; | 98 | static int as_status; |
| @@ -433,9 +431,6 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 433 | NSView *view = FRAME_NS_VIEW (f); | 431 | NSView *view = FRAME_NS_VIEW (f); |
| 434 | NSTRACE (x_set_icon_name); | 432 | NSTRACE (x_set_icon_name); |
| 435 | 433 | ||
| 436 | if (ns_in_resize) | ||
| 437 | return; | ||
| 438 | |||
| 439 | /* see if it's changed */ | 434 | /* see if it's changed */ |
| 440 | if (STRINGP (arg)) | 435 | if (STRINGP (arg)) |
| 441 | { | 436 | { |
| @@ -511,9 +506,6 @@ ns_set_name (struct frame *f, Lisp_Object name, int explicit) | |||
| 511 | { | 506 | { |
| 512 | NSTRACE (ns_set_name); | 507 | NSTRACE (ns_set_name); |
| 513 | 508 | ||
| 514 | if (ns_in_resize) | ||
| 515 | return; | ||
| 516 | |||
| 517 | /* Make sure that requests from lisp code override requests from | 509 | /* Make sure that requests from lisp code override requests from |
| 518 | Emacs redisplay code. */ | 510 | Emacs redisplay code. */ |
| 519 | if (explicit) | 511 | if (explicit) |
| @@ -612,7 +604,7 @@ ns_set_name_as_filename (struct frame *f) | |||
| 612 | NSString *str; | 604 | NSString *str; |
| 613 | NSTRACE (ns_set_name_as_filename); | 605 | NSTRACE (ns_set_name_as_filename); |
| 614 | 606 | ||
| 615 | if (f->explicit_name || ! NILP (f->title) || ns_in_resize) | 607 | if (f->explicit_name || ! NILP (f->title)) |
| 616 | return; | 608 | return; |
| 617 | 609 | ||
| 618 | block_input (); | 610 | block_input (); |
| @@ -1346,6 +1338,8 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 1346 | RES_TYPE_NUMBER); | 1338 | RES_TYPE_NUMBER); |
| 1347 | x_default_parameter (f, parms, Qalpha, Qnil, | 1339 | x_default_parameter (f, parms, Qalpha, Qnil, |
| 1348 | "alpha", "Alpha", RES_TYPE_NUMBER); | 1340 | "alpha", "Alpha", RES_TYPE_NUMBER); |
| 1341 | x_default_parameter (f, parms, Qfullscreen, Qnil, | ||
| 1342 | "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); | ||
| 1349 | 1343 | ||
| 1350 | width = FRAME_COLS (f); | 1344 | width = FRAME_COLS (f); |
| 1351 | height = FRAME_LINES (f); | 1345 | height = FRAME_LINES (f); |
| @@ -1955,32 +1949,29 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0, | |||
| 1955 | 1949 | ||
| 1956 | check_ns (); | 1950 | check_ns (); |
| 1957 | svcs = [[NSMenu alloc] initWithTitle: @"Services"]; | 1951 | svcs = [[NSMenu alloc] initWithTitle: @"Services"]; |
| 1958 | [NSApp setServicesMenu: svcs]; /* this and next rebuild on <10.4 */ | 1952 | [NSApp setServicesMenu: svcs]; |
| 1959 | [NSApp registerServicesMenuSendTypes: ns_send_types | 1953 | [NSApp registerServicesMenuSendTypes: ns_send_types |
| 1960 | returnTypes: ns_return_types]; | 1954 | returnTypes: ns_return_types]; |
| 1961 | 1955 | ||
| 1962 | /* On Tiger, services menu updating was made lazier (waits for user to | 1956 | /* On Tiger, services menu updating was made lazier (waits for user to |
| 1963 | actually click on the menu), so we have to force things along: */ | 1957 | actually click on the menu), so we have to force things along: */ |
| 1964 | #ifdef NS_IMPL_COCOA | 1958 | #ifdef NS_IMPL_COCOA |
| 1965 | if (NSAppKitVersionNumber >= 744.0) | 1959 | delegate = [svcs delegate]; |
| 1960 | if (delegate != nil) | ||
| 1966 | { | 1961 | { |
| 1967 | delegate = [svcs delegate]; | 1962 | if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)]) |
| 1968 | if (delegate != nil) | 1963 | [delegate menuNeedsUpdate: svcs]; |
| 1964 | if ([delegate respondsToSelector: | ||
| 1965 | @selector (menu:updateItem:atIndex:shouldCancel:)]) | ||
| 1969 | { | 1966 | { |
| 1970 | if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)]) | 1967 | int i, len = [delegate numberOfItemsInMenu: svcs]; |
| 1971 | [delegate menuNeedsUpdate: svcs]; | 1968 | for (i =0; i<len; i++) |
| 1972 | if ([delegate respondsToSelector: | 1969 | [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""]; |
| 1973 | @selector (menu:updateItem:atIndex:shouldCancel:)]) | 1970 | for (i =0; i<len; i++) |
| 1974 | { | 1971 | if (![delegate menu: svcs |
| 1975 | int i, len = [delegate numberOfItemsInMenu: svcs]; | 1972 | updateItem: (NSMenuItem *)[svcs itemAtIndex: i] |
| 1976 | for (i =0; i<len; i++) | 1973 | atIndex: i shouldCancel: NO]) |
| 1977 | [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""]; | 1974 | break; |
| 1978 | for (i =0; i<len; i++) | ||
| 1979 | if (![delegate menu: svcs | ||
| 1980 | updateItem: (NSMenuItem *)[svcs itemAtIndex: i] | ||
| 1981 | atIndex: i shouldCancel: NO]) | ||
| 1982 | break; | ||
| 1983 | } | ||
| 1984 | } | 1975 | } |
| 1985 | } | 1976 | } |
| 1986 | #endif | 1977 | #endif |
| @@ -2081,7 +2072,7 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result) | |||
| 2081 | *result = Qt; | 2072 | *result = Qt; |
| 2082 | // script returned an AppleScript result | 2073 | // script returned an AppleScript result |
| 2083 | if ((typeUnicodeText == [returnDescriptor descriptorType]) || | 2074 | if ((typeUnicodeText == [returnDescriptor descriptorType]) || |
| 2084 | #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 | 2075 | #if defined (NS_IMPL_COCOA) |
| 2085 | (typeUTF16ExternalRepresentation | 2076 | (typeUTF16ExternalRepresentation |
| 2086 | == [returnDescriptor descriptorType]) || | 2077 | == [returnDescriptor descriptorType]) || |
| 2087 | #endif | 2078 | #endif |
diff --git a/src/nsimage.m b/src/nsimage.m index 370cf832c7c..884c0763fd4 100644 --- a/src/nsimage.m +++ b/src/nsimage.m | |||
| @@ -403,7 +403,6 @@ static EmacsImage *ImageList = nil; | |||
| 403 | if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) | 403 | if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) |
| 404 | { | 404 | { |
| 405 | bmRep = (NSBitmapImageRep *) rep; | 405 | bmRep = (NSBitmapImageRep *) rep; |
| 406 | onTiger = [bmRep respondsToSelector: @selector (colorAtX:y:)]; | ||
| 407 | 406 | ||
| 408 | if ([bmRep numberOfPlanes] >= 3) | 407 | if ([bmRep numberOfPlanes] >= 3) |
| 409 | [bmRep getBitmapDataPlanes: pixmapData]; | 408 | [bmRep getBitmapDataPlanes: pixmapData]; |
| @@ -435,7 +434,7 @@ static EmacsImage *ImageList = nil; | |||
| 435 | | (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8) | 434 | | (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8) |
| 436 | | (pixmapData[2][loc]); | 435 | | (pixmapData[2][loc]); |
| 437 | } | 436 | } |
| 438 | else if (onTiger) | 437 | else |
| 439 | { | 438 | { |
| 440 | NSColor *color = [bmRep colorAtX: x y: y]; | 439 | NSColor *color = [bmRep colorAtX: x y: y]; |
| 441 | CGFloat r, g, b, a; | 440 | CGFloat r, g, b, a; |
| @@ -445,7 +444,6 @@ static EmacsImage *ImageList = nil; | |||
| 445 | | ((int)(b * 255.0)); | 444 | | ((int)(b * 255.0)); |
| 446 | 445 | ||
| 447 | } | 446 | } |
| 448 | return 0; | ||
| 449 | } | 447 | } |
| 450 | 448 | ||
| 451 | - (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r | 449 | - (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r |
| @@ -463,7 +461,7 @@ static EmacsImage *ImageList = nil; | |||
| 463 | pixmapData[2][loc] = b; | 461 | pixmapData[2][loc] = b; |
| 464 | pixmapData[3][loc] = a; | 462 | pixmapData[3][loc] = a; |
| 465 | } | 463 | } |
| 466 | else if (onTiger) | 464 | else |
| 467 | { | 465 | { |
| 468 | [bmRep setColor: | 466 | [bmRep setColor: |
| 469 | [NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0) | 467 | [NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0) |
| @@ -483,7 +481,7 @@ static EmacsImage *ImageList = nil; | |||
| 483 | 481 | ||
| 484 | pixmapData[3][loc] = a; | 482 | pixmapData[3][loc] = a; |
| 485 | } | 483 | } |
| 486 | else if (onTiger) | 484 | else |
| 487 | { | 485 | { |
| 488 | NSColor *color = [bmRep colorAtX: x y: y]; | 486 | NSColor *color = [bmRep colorAtX: x y: y]; |
| 489 | color = [color colorWithAlphaComponent: (a / 255.0)]; | 487 | color = [color colorWithAlphaComponent: (a / 255.0)]; |
diff --git a/src/nsmenu.m b/src/nsmenu.m index b60cc005c5f..9af732c6c45 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -722,11 +722,6 @@ extern NSString *NSMenuDidBeginTrackingNotification; | |||
| 722 | #ifdef NS_IMPL_GNUSTEP | 722 | #ifdef NS_IMPL_GNUSTEP |
| 723 | if ([[self window] isVisible]) | 723 | if ([[self window] isVisible]) |
| 724 | [self sizeToFit]; | 724 | [self sizeToFit]; |
| 725 | #else | ||
| 726 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2 | ||
| 727 | if ([self supermenu] == nil) | ||
| 728 | [self sizeToFit]; | ||
| 729 | #endif | ||
| 730 | #endif | 725 | #endif |
| 731 | } | 726 | } |
| 732 | 727 | ||
diff --git a/src/nsselect.m b/src/nsselect.m index 95bc1a95957..c0c412c6fb2 100644 --- a/src/nsselect.m +++ b/src/nsselect.m | |||
| @@ -295,7 +295,7 @@ ns_string_from_pasteboard (id pb) | |||
| 295 | utfStr = [mstr UTF8String]; | 295 | utfStr = [mstr UTF8String]; |
| 296 | length = [mstr lengthOfBytesUsingEncoding: NSUTF8StringEncoding]; | 296 | length = [mstr lengthOfBytesUsingEncoding: NSUTF8StringEncoding]; |
| 297 | 297 | ||
| 298 | #if ! defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4 | 298 | #if ! defined (NS_IMPL_COCOA) |
| 299 | if (!utfStr) | 299 | if (!utfStr) |
| 300 | { | 300 | { |
| 301 | utfStr = [mstr cString]; | 301 | utfStr = [mstr cString]; |
| @@ -306,7 +306,7 @@ ns_string_from_pasteboard (id pb) | |||
| 306 | NS_HANDLER | 306 | NS_HANDLER |
| 307 | { | 307 | { |
| 308 | message1 ("ns_string_from_pasteboard: UTF8String failed\n"); | 308 | message1 ("ns_string_from_pasteboard: UTF8String failed\n"); |
| 309 | #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 | 309 | #if defined (NS_IMPL_COCOA) |
| 310 | utfStr = "Conversion failed"; | 310 | utfStr = "Conversion failed"; |
| 311 | #else | 311 | #else |
| 312 | utfStr = [str lossyCString]; | 312 | utfStr = [str lossyCString]; |
diff --git a/src/nsterm.h b/src/nsterm.h index f06e0cb0f7f..958d1ce7853 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -26,9 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | #ifdef HAVE_NS | 26 | #ifdef HAVE_NS |
| 27 | 27 | ||
| 28 | #ifdef NS_IMPL_COCOA | 28 | #ifdef NS_IMPL_COCOA |
| 29 | #ifndef MAC_OS_X_VERSION_10_3 | ||
| 30 | #define MAC_OS_X_VERSION_10_3 1030 | ||
| 31 | #endif | ||
| 32 | #ifndef MAC_OS_X_VERSION_10_4 | 29 | #ifndef MAC_OS_X_VERSION_10_4 |
| 33 | #define MAC_OS_X_VERSION_10_4 1040 | 30 | #define MAC_OS_X_VERSION_10_4 1040 |
| 34 | #endif | 31 | #endif |
| @@ -86,7 +83,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 86 | BOOL windowClosing; | 83 | BOOL windowClosing; |
| 87 | NSString *workingText; | 84 | NSString *workingText; |
| 88 | BOOL processingCompose; | 85 | BOOL processingCompose; |
| 89 | int fs_state, fs_before_fs, next_maximized, tbar_height, bwidth; | 86 | int fs_state, fs_before_fs, next_maximized; |
| 87 | int tibar_height, tobar_height, bwidth; | ||
| 90 | int maximized_width, maximized_height; | 88 | int maximized_width, maximized_height; |
| 91 | NSWindow *nonfs_window; | 89 | NSWindow *nonfs_window; |
| 92 | @public | 90 | @public |
| @@ -285,7 +283,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 285 | int refCount; | 283 | int refCount; |
| 286 | NSBitmapImageRep *bmRep; /* used for accessing pixel data */ | 284 | NSBitmapImageRep *bmRep; /* used for accessing pixel data */ |
| 287 | unsigned char *pixmapData[5]; /* shortcut to access pixel data */ | 285 | unsigned char *pixmapData[5]; /* shortcut to access pixel data */ |
| 288 | BOOL onTiger; | ||
| 289 | NSColor *stippleMask; | 286 | NSColor *stippleMask; |
| 290 | } | 287 | } |
| 291 | + allocInitFromFile: (Lisp_Object)file; | 288 | + allocInitFromFile: (Lisp_Object)file; |
| @@ -354,7 +351,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 354 | 351 | ||
| 355 | /* ========================================================================== | 352 | /* ========================================================================== |
| 356 | 353 | ||
| 357 | Rendering on Panther and above | 354 | Rendering |
| 358 | 355 | ||
| 359 | ========================================================================== */ | 356 | ========================================================================== */ |
| 360 | 357 | ||
| @@ -379,7 +376,7 @@ extern NSString *ns_app_name; | |||
| 379 | extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu; | 376 | extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu; |
| 380 | 377 | ||
| 381 | /* Apple removed the declaration, but kept the implementation */ | 378 | /* Apple removed the declaration, but kept the implementation */ |
| 382 | #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 | 379 | #if defined (NS_IMPL_COCOA) |
| 383 | @interface NSApplication (EmacsApp) | 380 | @interface NSApplication (EmacsApp) |
| 384 | - (void)setAppleMenu: (NSMenu *)menu; | 381 | - (void)setAppleMenu: (NSMenu *)menu; |
| 385 | @end | 382 | @end |
| @@ -482,10 +479,9 @@ struct nsfont_info | |||
| 482 | float size; | 479 | float size; |
| 483 | #ifdef __OBJC__ | 480 | #ifdef __OBJC__ |
| 484 | NSFont *nsfont; | 481 | NSFont *nsfont; |
| 485 | /* cgfont and synthItal are used only on OS X 10.3+ */ | 482 | #if defined (NS_IMPL_COCOA) |
| 486 | #if defined (NS_IMPL_COCOA) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) | ||
| 487 | CGFontRef cgfont; | 483 | CGFontRef cgfont; |
| 488 | #else /* GNUstep or OS X < 10.3 */ | 484 | #else /* GNUstep */ |
| 489 | void *cgfont; | 485 | void *cgfont; |
| 490 | #endif | 486 | #endif |
| 491 | #else /* ! OBJC */ | 487 | #else /* ! OBJC */ |
diff --git a/src/nsterm.m b/src/nsterm.m index 2df0e1a1ad5..6b739befeeb 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -183,7 +183,6 @@ static int ns_window_num = 0; | |||
| 183 | static NSRect uRect; | 183 | static NSRect uRect; |
| 184 | #endif | 184 | #endif |
| 185 | static BOOL gsaved = NO; | 185 | static BOOL gsaved = NO; |
| 186 | BOOL ns_in_resize = NO; | ||
| 187 | static BOOL ns_fake_keydown = NO; | 186 | static BOOL ns_fake_keydown = NO; |
| 188 | int ns_tmp_flags; /* FIXME */ | 187 | int ns_tmp_flags; /* FIXME */ |
| 189 | struct nsfont_info *ns_tmp_font; /* FIXME */ | 188 | struct nsfont_info *ns_tmp_font; /* FIXME */ |
| @@ -493,17 +492,6 @@ ns_release_autorelease_pool (void *pool) | |||
| 493 | 492 | ||
| 494 | ========================================================================== */ | 493 | ========================================================================== */ |
| 495 | 494 | ||
| 496 | static NSRect | ||
| 497 | ns_resize_handle_rect (NSWindow *window) | ||
| 498 | { | ||
| 499 | NSRect r = [window frame]; | ||
| 500 | r.origin.x = r.size.width - RESIZE_HANDLE_SIZE; | ||
| 501 | r.origin.y = 0; | ||
| 502 | r.size.width = r.size.height = RESIZE_HANDLE_SIZE; | ||
| 503 | return r; | ||
| 504 | } | ||
| 505 | |||
| 506 | |||
| 507 | // | 495 | // |
| 508 | // Window constraining | 496 | // Window constraining |
| 509 | // ------------------- | 497 | // ------------------- |
| @@ -581,9 +569,6 @@ ns_menu_bar_should_be_hidden (void) | |||
| 581 | static void | 569 | static void |
| 582 | ns_update_auto_hide_menu_bar (void) | 570 | ns_update_auto_hide_menu_bar (void) |
| 583 | { | 571 | { |
| 584 | #ifndef MAC_OS_X_VERSION_10_6 | ||
| 585 | #define MAC_OS_X_VERSION_10_6 1060 | ||
| 586 | #endif | ||
| 587 | #ifdef NS_IMPL_COCOA | 572 | #ifdef NS_IMPL_COCOA |
| 588 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 | 573 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 |
| 589 | block_input (); | 574 | block_input (); |
| @@ -1068,8 +1053,23 @@ x_make_frame_visible (struct frame *f) | |||
| 1068 | if this ends up the case again, comment this out again. */ | 1053 | if this ends up the case again, comment this out again. */ |
| 1069 | if (!FRAME_VISIBLE_P (f)) | 1054 | if (!FRAME_VISIBLE_P (f)) |
| 1070 | { | 1055 | { |
| 1056 | EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); | ||
| 1071 | f->async_visible = 1; | 1057 | f->async_visible = 1; |
| 1072 | ns_raise_frame (f); | 1058 | ns_raise_frame (f); |
| 1059 | |||
| 1060 | #ifdef NEW_STYLE_FS | ||
| 1061 | /* Making a new frame from a fullscreen frame will make the new frame | ||
| 1062 | fullscreen also. So skip handleFS as this will print an error. */ | ||
| 1063 | if (f->want_fullscreen == FULLSCREEN_BOTH | ||
| 1064 | && ([[view window] styleMask] & NSFullScreenWindowMask) != 0) | ||
| 1065 | return; | ||
| 1066 | #endif | ||
| 1067 | if (f->want_fullscreen != FULLSCREEN_NONE) | ||
| 1068 | { | ||
| 1069 | block_input (); | ||
| 1070 | [view handleFS]; | ||
| 1071 | unblock_input (); | ||
| 1072 | } | ||
| 1073 | } | 1073 | } |
| 1074 | } | 1074 | } |
| 1075 | 1075 | ||
| @@ -1317,6 +1317,18 @@ ns_fullscreen_hook (FRAME_PTR f) | |||
| 1317 | EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); | 1317 | EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); |
| 1318 | 1318 | ||
| 1319 | if (! f->async_visible) return; | 1319 | if (! f->async_visible) return; |
| 1320 | #ifndef NEW_STYLE_FS | ||
| 1321 | if (f->want_fullscreen == FULLSCREEN_BOTH) | ||
| 1322 | { | ||
| 1323 | /* Old style fs don't initiate correctly if created from | ||
| 1324 | init/default-frame alist, so use a timer (not nice...). | ||
| 1325 | */ | ||
| 1326 | [NSTimer scheduledTimerWithTimeInterval: 0.5 target: view | ||
| 1327 | selector: @selector (handleFS) | ||
| 1328 | userInfo: nil repeats: NO]; | ||
| 1329 | return; | ||
| 1330 | } | ||
| 1331 | #endif | ||
| 1320 | 1332 | ||
| 1321 | block_input (); | 1333 | block_input (); |
| 1322 | [view handleFS]; | 1334 | [view handleFS]; |
| @@ -1956,8 +1968,6 @@ ns_clear_frame (struct frame *f) | |||
| 1956 | NSRect r; | 1968 | NSRect r; |
| 1957 | 1969 | ||
| 1958 | NSTRACE (ns_clear_frame); | 1970 | NSTRACE (ns_clear_frame); |
| 1959 | if (ns_in_resize) | ||
| 1960 | return; | ||
| 1961 | 1971 | ||
| 1962 | /* comes on initial frame because we have | 1972 | /* comes on initial frame because we have |
| 1963 | after-make-frame-functions = select-frame */ | 1973 | after-make-frame-functions = select-frame */ |
| @@ -1977,10 +1987,6 @@ ns_clear_frame (struct frame *f) | |||
| 1977 | NSRectFill (r); | 1987 | NSRectFill (r); |
| 1978 | ns_unfocus (f); | 1988 | ns_unfocus (f); |
| 1979 | 1989 | ||
| 1980 | #ifdef NS_IMPL_COCOA | ||
| 1981 | [[view window] display]; /* redraw resize handle */ | ||
| 1982 | #endif | ||
| 1983 | |||
| 1984 | /* as of 2006/11 or so this is now needed */ | 1990 | /* as of 2006/11 or so this is now needed */ |
| 1985 | ns_redraw_scroll_bars (f); | 1991 | ns_redraw_scroll_bars (f); |
| 1986 | unblock_input (); | 1992 | unblock_input (); |
| @@ -2006,35 +2012,8 @@ ns_clear_frame_area (struct frame *f, int x, int y, int width, int height) | |||
| 2006 | ns_focus (f, &r, 1); | 2012 | ns_focus (f, &r, 1); |
| 2007 | [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; | 2013 | [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; |
| 2008 | 2014 | ||
| 2009 | #ifdef NS_IMPL_COCOA | ||
| 2010 | { | ||
| 2011 | /* clip out the resize handle */ | ||
| 2012 | NSWindow *window = [FRAME_NS_VIEW (f) window]; | ||
| 2013 | NSRect ir | ||
| 2014 | = [view convertRect: ns_resize_handle_rect (window) fromView: nil]; | ||
| 2015 | |||
| 2016 | ir = NSIntersectionRect (r, ir); | ||
| 2017 | if (NSIsEmptyRect (ir)) | ||
| 2018 | { | ||
| 2019 | #endif | ||
| 2020 | |||
| 2021 | NSRectFill (r); | 2015 | NSRectFill (r); |
| 2022 | 2016 | ||
| 2023 | #ifdef NS_IMPL_COCOA | ||
| 2024 | } | ||
| 2025 | else | ||
| 2026 | { | ||
| 2027 | NSRect r1 = r, r2 = r; /* upper and lower non-intersecting */ | ||
| 2028 | r1.size.height -= ir.size.height; | ||
| 2029 | r2.origin.y += r1.size.height; | ||
| 2030 | r2.size.width -= ir.size.width; | ||
| 2031 | r2.size.height = ir.size.height; | ||
| 2032 | NSRectFill (r1); | ||
| 2033 | NSRectFill (r2); | ||
| 2034 | } | ||
| 2035 | } | ||
| 2036 | #endif | ||
| 2037 | |||
| 2038 | ns_unfocus (f); | 2017 | ns_unfocus (f); |
| 2039 | return; | 2018 | return; |
| 2040 | } | 2019 | } |
| @@ -2996,8 +2975,10 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) | |||
| 2996 | { | 2975 | { |
| 2997 | #if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 | 2976 | #if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 |
| 2998 | NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height); | 2977 | NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height); |
| 2978 | NSRect ir = NSMakeRect (s->slice.x, s->slice.y, | ||
| 2979 | s->slice.width, s->slice.height); | ||
| 2999 | [img drawInRect: dr | 2980 | [img drawInRect: dr |
| 3000 | fromRect: NSZeroRect | 2981 | fromRect: ir |
| 3001 | operation: NSCompositeSourceOver | 2982 | operation: NSCompositeSourceOver |
| 3002 | fraction: 1.0 | 2983 | fraction: 1.0 |
| 3003 | respectFlipped: YES | 2984 | respectFlipped: YES |
| @@ -4210,6 +4191,11 @@ ns_term_init (Lisp_Object display_name) | |||
| 4210 | NSColorPboardType, | 4191 | NSColorPboardType, |
| 4211 | NSFontPboardType, nil] retain]; | 4192 | NSFontPboardType, nil] retain]; |
| 4212 | 4193 | ||
| 4194 | #ifndef NEW_STYLE_FS | ||
| 4195 | /* If fullscreen is in init/default-frame-alist, focus isn't set | ||
| 4196 | right for fullscreen windows, so set this. */ | ||
| 4197 | [NSApp activateIgnoringOtherApps:YES]; | ||
| 4198 | #endif | ||
| 4213 | 4199 | ||
| 4214 | [NSApp run]; | 4200 | [NSApp run]; |
| 4215 | ns_do_open_file = YES; | 4201 | ns_do_open_file = YES; |
| @@ -4282,34 +4268,6 @@ ns_term_shutdown (int sig) | |||
| 4282 | return; | 4268 | return; |
| 4283 | } | 4269 | } |
| 4284 | 4270 | ||
| 4285 | #ifdef NS_IMPL_COCOA | ||
| 4286 | /* pass mouse down in resize handle and subsequent drags directly to | ||
| 4287 | EmacsWindow so we can generate continuous redisplays */ | ||
| 4288 | if (ns_in_resize) | ||
| 4289 | { | ||
| 4290 | if (type == NSLeftMouseDragged) | ||
| 4291 | { | ||
| 4292 | [window mouseDragged: theEvent]; | ||
| 4293 | return; | ||
| 4294 | } | ||
| 4295 | else if (type == NSLeftMouseUp) | ||
| 4296 | { | ||
| 4297 | [window mouseUp: theEvent]; | ||
| 4298 | return; | ||
| 4299 | } | ||
| 4300 | } | ||
| 4301 | else if (type == NSLeftMouseDown) | ||
| 4302 | { | ||
| 4303 | NSRect r = ns_resize_handle_rect (window); | ||
| 4304 | if (NSPointInRect ([theEvent locationInWindow], r)) | ||
| 4305 | { | ||
| 4306 | ns_in_resize = YES; | ||
| 4307 | [window mouseDown: theEvent]; | ||
| 4308 | return; | ||
| 4309 | } | ||
| 4310 | } | ||
| 4311 | #endif | ||
| 4312 | |||
| 4313 | if (type == NSApplicationDefined) | 4271 | if (type == NSApplicationDefined) |
| 4314 | { | 4272 | { |
| 4315 | /* Events posted by ns_send_appdefined interrupt the run loop here. | 4273 | /* Events posted by ns_send_appdefined interrupt the run loop here. |
| @@ -5505,10 +5463,17 @@ not_in_argv (NSString *arg) | |||
| 5505 | 5463 | ||
| 5506 | - (void)windowDidResize: (NSNotification *)notification | 5464 | - (void)windowDidResize: (NSNotification *)notification |
| 5507 | { | 5465 | { |
| 5466 | |||
| 5467 | #if !defined (NEW_STYLE_FS) && ! defined (NS_IMPL_GNUSTEP) | ||
| 5468 | NSWindow *theWindow = [notification object]; | ||
| 5469 | /* We can get notification on the non-FS window when in fullscreen mode. */ | ||
| 5470 | if ([self window] != theWindow) return; | ||
| 5471 | #endif | ||
| 5472 | |||
| 5508 | #ifdef NS_IMPL_GNUSTEP | 5473 | #ifdef NS_IMPL_GNUSTEP |
| 5509 | NSWindow *theWindow = [notification object]; | 5474 | NSWindow *theWindow = [notification object]; |
| 5510 | 5475 | ||
| 5511 | /* in GNUstep, at least currently, it's possible to get a didResize | 5476 | /* In GNUstep, at least currently, it's possible to get a didResize |
| 5512 | without getting a willResize.. therefore we need to act as if we got | 5477 | without getting a willResize.. therefore we need to act as if we got |
| 5513 | the willResize now */ | 5478 | the willResize now */ |
| 5514 | NSSize sz = [theWindow frame].size; | 5479 | NSSize sz = [theWindow frame].size; |
| @@ -5526,20 +5491,10 @@ not_in_argv (NSString *arg) | |||
| 5526 | } | 5491 | } |
| 5527 | #endif /* NS_IMPL_COCOA */ | 5492 | #endif /* NS_IMPL_COCOA */ |
| 5528 | 5493 | ||
| 5529 | /* Avoid loop under GNUstep due to call at beginning of this function. | ||
| 5530 | (x_set_window_size causes a resize which causes | ||
| 5531 | a "windowDidResize" which calls x_set_window_size). */ | ||
| 5532 | #ifndef NS_IMPL_GNUSTEP | ||
| 5533 | if (cols > 0 && rows > 0) | 5494 | if (cols > 0 && rows > 0) |
| 5534 | { | 5495 | { |
| 5535 | if (ns_in_resize) | 5496 | [self updateFrameSize: YES]; |
| 5536 | x_set_window_size (emacsframe, 0, cols, rows); | ||
| 5537 | else | ||
| 5538 | { | ||
| 5539 | [self updateFrameSize: YES]; | ||
| 5540 | } | ||
| 5541 | } | 5497 | } |
| 5542 | #endif | ||
| 5543 | 5498 | ||
| 5544 | ns_send_appdefined (-1); | 5499 | ns_send_appdefined (-1); |
| 5545 | } | 5500 | } |
| @@ -5661,7 +5616,7 @@ not_in_argv (NSString *arg) | |||
| 5661 | 5616 | ||
| 5662 | wr = [win frame]; | 5617 | wr = [win frame]; |
| 5663 | bwidth = f->border_width = wr.size.width - r.size.width; | 5618 | bwidth = f->border_width = wr.size.width - r.size.width; |
| 5664 | tbar_height = FRAME_NS_TITLEBAR_HEIGHT (f) = wr.size.height - r.size.height; | 5619 | tibar_height = FRAME_NS_TITLEBAR_HEIGHT (f) = wr.size.height - r.size.height; |
| 5665 | 5620 | ||
| 5666 | [win setAcceptsMouseMovedEvents: YES]; | 5621 | [win setAcceptsMouseMovedEvents: YES]; |
| 5667 | [win setDelegate: self]; | 5622 | [win setDelegate: self]; |
| @@ -5870,8 +5825,16 @@ not_in_argv (NSString *arg) | |||
| 5870 | - (void)windowDidEnterFullScreen:(NSNotification *)notification | 5825 | - (void)windowDidEnterFullScreen:(NSNotification *)notification |
| 5871 | { | 5826 | { |
| 5872 | [self setFSValue: FULLSCREEN_BOTH]; | 5827 | [self setFSValue: FULLSCREEN_BOTH]; |
| 5873 | #ifndef NEW_STYLE_FS | 5828 | #ifdef NEW_STYLE_FS |
| 5829 | // Fix bad background. | ||
| 5830 | if ([toolbar isVisible]) | ||
| 5831 | { | ||
| 5832 | [toolbar setVisible:NO]; | ||
| 5833 | [toolbar setVisible:YES]; | ||
| 5834 | } | ||
| 5835 | #else | ||
| 5874 | [self windowDidBecomeKey:notification]; | 5836 | [self windowDidBecomeKey:notification]; |
| 5837 | [nonfs_window orderOut:self]; | ||
| 5875 | #endif | 5838 | #endif |
| 5876 | } | 5839 | } |
| 5877 | 5840 | ||
| @@ -5891,11 +5854,6 @@ not_in_argv (NSString *arg) | |||
| 5891 | 5854 | ||
| 5892 | - (void)toggleFullScreen: (id)sender | 5855 | - (void)toggleFullScreen: (id)sender |
| 5893 | { | 5856 | { |
| 5894 | /* Bugs remain: | ||
| 5895 | 1) Having fullscreen in initial/default frame alist. | ||
| 5896 | 2) Fullscreen in default frame alist only applied to first frame. | ||
| 5897 | */ | ||
| 5898 | |||
| 5899 | #ifdef NEW_STYLE_FS | 5857 | #ifdef NEW_STYLE_FS |
| 5900 | [[self window] toggleFullScreen:sender]; | 5858 | [[self window] toggleFullScreen:sender]; |
| 5901 | #else | 5859 | #else |
| @@ -5904,7 +5862,7 @@ not_in_argv (NSString *arg) | |||
| 5904 | isEqual:[[NSScreen screens] objectAtIndex:0]]; | 5862 | isEqual:[[NSScreen screens] objectAtIndex:0]]; |
| 5905 | struct frame *f = emacsframe; | 5863 | struct frame *f = emacsframe; |
| 5906 | NSSize sz; | 5864 | NSSize sz; |
| 5907 | NSRect r; | 5865 | NSRect r, wr = [w frame]; |
| 5908 | NSColor *col = ns_lookup_indexed_color (NS_FACE_BACKGROUND | 5866 | NSColor *col = ns_lookup_indexed_color (NS_FACE_BACKGROUND |
| 5909 | (FRAME_DEFAULT_FACE (f)), | 5867 | (FRAME_DEFAULT_FACE (f)), |
| 5910 | f); | 5868 | f); |
| @@ -5930,7 +5888,7 @@ not_in_argv (NSString *arg) | |||
| 5930 | } | 5888 | } |
| 5931 | 5889 | ||
| 5932 | fw = [[EmacsFSWindow alloc] | 5890 | fw = [[EmacsFSWindow alloc] |
| 5933 | initWithContentRect:[w contentRectForFrameRect:[w frame]] | 5891 | initWithContentRect:[w contentRectForFrameRect:wr] |
| 5934 | styleMask:NSBorderlessWindowMask | 5892 | styleMask:NSBorderlessWindowMask |
| 5935 | backing:NSBackingStoreBuffered | 5893 | backing:NSBackingStoreBuffered |
| 5936 | defer:YES | 5894 | defer:YES |
| @@ -5938,9 +5896,7 @@ not_in_argv (NSString *arg) | |||
| 5938 | 5896 | ||
| 5939 | [fw setContentView:[w contentView]]; | 5897 | [fw setContentView:[w contentView]]; |
| 5940 | [fw setTitle:[w title]]; | 5898 | [fw setTitle:[w title]]; |
| 5941 | [fw makeKeyAndOrderFront:NSApp]; | ||
| 5942 | [fw setDelegate:self]; | 5899 | [fw setDelegate:self]; |
| 5943 | [fw makeFirstResponder:self]; | ||
| 5944 | [fw setAcceptsMouseMovedEvents: YES]; | 5900 | [fw setAcceptsMouseMovedEvents: YES]; |
| 5945 | [fw useOptimizedDrawing: YES]; | 5901 | [fw useOptimizedDrawing: YES]; |
| 5946 | [fw setResizeIncrements: sz]; | 5902 | [fw setResizeIncrements: sz]; |
| @@ -5950,18 +5906,26 @@ not_in_argv (NSString *arg) | |||
| 5950 | 5906 | ||
| 5951 | f->border_width = 0; | 5907 | f->border_width = 0; |
| 5952 | FRAME_NS_TITLEBAR_HEIGHT (f) = 0; | 5908 | FRAME_NS_TITLEBAR_HEIGHT (f) = 0; |
| 5909 | tobar_height = FRAME_TOOLBAR_HEIGHT (f); | ||
| 5910 | FRAME_TOOLBAR_HEIGHT (f) = 0; | ||
| 5911 | FRAME_EXTERNAL_TOOL_BAR (f) = 0; | ||
| 5953 | 5912 | ||
| 5954 | nonfs_window = w; | 5913 | nonfs_window = w; |
| 5914 | |||
| 5955 | [self windowWillEnterFullScreen:nil]; | 5915 | [self windowWillEnterFullScreen:nil]; |
| 5916 | [fw makeKeyAndOrderFront:NSApp]; | ||
| 5917 | [fw makeFirstResponder:self]; | ||
| 5956 | [w orderOut:self]; | 5918 | [w orderOut:self]; |
| 5957 | r = [fw frameRectForContentRect:[[fw screen] frame]]; | 5919 | r = [fw frameRectForContentRect:[[fw screen] frame]]; |
| 5958 | [fw setFrame: r display:YES animate:YES]; | 5920 | [fw setFrame: r display:YES animate:YES]; |
| 5959 | [self windowDidEnterFullScreen:nil]; | 5921 | [self windowDidEnterFullScreen:nil]; |
| 5922 | [fw display]; | ||
| 5960 | } | 5923 | } |
| 5961 | else | 5924 | else |
| 5962 | { | 5925 | { |
| 5963 | fw = w; | 5926 | fw = w; |
| 5964 | w = nonfs_window; | 5927 | w = nonfs_window; |
| 5928 | nonfs_window = nil; | ||
| 5965 | 5929 | ||
| 5966 | if (onFirstScreen) | 5930 | if (onFirstScreen) |
| 5967 | { | 5931 | { |
| @@ -5980,7 +5944,10 @@ not_in_argv (NSString *arg) | |||
| 5980 | [w setOpaque: NO]; | 5944 | [w setOpaque: NO]; |
| 5981 | 5945 | ||
| 5982 | f->border_width = bwidth; | 5946 | f->border_width = bwidth; |
| 5983 | FRAME_NS_TITLEBAR_HEIGHT (f) = tbar_height; | 5947 | FRAME_NS_TITLEBAR_HEIGHT (f) = tibar_height; |
| 5948 | FRAME_TOOLBAR_HEIGHT (f) = tobar_height; | ||
| 5949 | if (tobar_height) | ||
| 5950 | FRAME_EXTERNAL_TOOL_BAR (f) = 1; | ||
| 5984 | 5951 | ||
| 5985 | [self windowWillExitFullScreen:nil]; | 5952 | [self windowWillExitFullScreen:nil]; |
| 5986 | [fw setFrame: [w frame] display:YES animate:YES]; | 5953 | [fw setFrame: [w frame] display:YES animate:YES]; |
| @@ -6152,7 +6119,7 @@ not_in_argv (NSString *arg) | |||
| 6152 | 6119 | ||
| 6153 | NSTRACE (drawRect); | 6120 | NSTRACE (drawRect); |
| 6154 | 6121 | ||
| 6155 | if (!emacsframe || !emacsframe->output_data.ns || ns_in_resize) | 6122 | if (!emacsframe || !emacsframe->output_data.ns) |
| 6156 | return; | 6123 | return; |
| 6157 | 6124 | ||
| 6158 | ns_clear_frame_area (emacsframe, x, y, width, height); | 6125 | ns_clear_frame_area (emacsframe, x, y, width, height); |
| @@ -6489,60 +6456,6 @@ not_in_argv (NSString *arg) | |||
| 6489 | return [super constrainFrameRect:frameRect toScreen:screen]; | 6456 | return [super constrainFrameRect:frameRect toScreen:screen]; |
| 6490 | } | 6457 | } |
| 6491 | 6458 | ||
| 6492 | |||
| 6493 | /* called only on resize clicks by special case in EmacsApp-sendEvent */ | ||
| 6494 | - (void)mouseDown: (NSEvent *)theEvent | ||
| 6495 | { | ||
| 6496 | if (ns_in_resize) | ||
| 6497 | { | ||
| 6498 | NSSize size = [[theEvent window] frame].size; | ||
| 6499 | grabOffset = [theEvent locationInWindow]; | ||
| 6500 | grabOffset.x = size.width - grabOffset.x; | ||
| 6501 | } | ||
| 6502 | else | ||
| 6503 | [super mouseDown: theEvent]; | ||
| 6504 | } | ||
| 6505 | |||
| 6506 | |||
| 6507 | /* stop resizing */ | ||
| 6508 | - (void)mouseUp: (NSEvent *)theEvent | ||
| 6509 | { | ||
| 6510 | if (ns_in_resize) | ||
| 6511 | { | ||
| 6512 | struct frame *f = ((EmacsView *)[self delegate])->emacsframe; | ||
| 6513 | ns_in_resize = NO; | ||
| 6514 | ns_set_name_as_filename (f); | ||
| 6515 | [self display]; | ||
| 6516 | ns_send_appdefined (-1); | ||
| 6517 | } | ||
| 6518 | else | ||
| 6519 | [super mouseUp: theEvent]; | ||
| 6520 | } | ||
| 6521 | |||
| 6522 | |||
| 6523 | /* send resize events */ | ||
| 6524 | - (void)mouseDragged: (NSEvent *)theEvent | ||
| 6525 | { | ||
| 6526 | if (ns_in_resize) | ||
| 6527 | { | ||
| 6528 | NSPoint p = [theEvent locationInWindow]; | ||
| 6529 | NSSize size, vettedSize, origSize = [self frame].size; | ||
| 6530 | |||
| 6531 | size.width = p.x + grabOffset.x; | ||
| 6532 | size.height = origSize.height - p.y + grabOffset.y; | ||
| 6533 | |||
| 6534 | if (size.width == origSize.width && size.height == origSize.height) | ||
| 6535 | return; | ||
| 6536 | |||
| 6537 | vettedSize = [[self delegate] windowWillResize: self toSize: size]; | ||
| 6538 | [[NSNotificationCenter defaultCenter] | ||
| 6539 | postNotificationName: NSWindowDidResizeNotification | ||
| 6540 | object: self]; | ||
| 6541 | } | ||
| 6542 | else | ||
| 6543 | [super mouseDragged: theEvent]; | ||
| 6544 | } | ||
| 6545 | |||
| 6546 | @end /* EmacsWindow */ | 6459 | @end /* EmacsWindow */ |
| 6547 | 6460 | ||
| 6548 | 6461 | ||
| @@ -6553,6 +6466,11 @@ not_in_argv (NSString *arg) | |||
| 6553 | return YES; | 6466 | return YES; |
| 6554 | } | 6467 | } |
| 6555 | 6468 | ||
| 6469 | - (BOOL)canBecomeMainWindow | ||
| 6470 | { | ||
| 6471 | return YES; | ||
| 6472 | } | ||
| 6473 | |||
| 6556 | @end | 6474 | @end |
| 6557 | 6475 | ||
| 6558 | /* ========================================================================== | 6476 | /* ========================================================================== |
| @@ -7168,7 +7086,7 @@ allowing it to be used at a lower level for accented character entry."); | |||
| 7168 | ns_function_modifier = Qnone; | 7086 | ns_function_modifier = Qnone; |
| 7169 | 7087 | ||
| 7170 | DEFVAR_LISP ("ns-antialias-text", ns_antialias_text, | 7088 | DEFVAR_LISP ("ns-antialias-text", ns_antialias_text, |
| 7171 | "Non-nil (the default) means to render text antialiased. Only has an effect on OS X Panther and above."); | 7089 | "Non-nil (the default) means to render text antialiased."); |
| 7172 | ns_antialias_text = Qt; | 7090 | ns_antialias_text = Qt; |
| 7173 | 7091 | ||
| 7174 | DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit, | 7092 | DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit, |
diff --git a/src/sysdep.c b/src/sysdep.c index 74617fcaf0f..35beeaa7202 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1545,8 +1545,18 @@ deliver_thread_signal (int sig, signal_handler_t handler) | |||
| 1545 | 1545 | ||
| 1546 | #if !HAVE_DECL_SYS_SIGLIST | 1546 | #if !HAVE_DECL_SYS_SIGLIST |
| 1547 | # undef sys_siglist | 1547 | # undef sys_siglist |
| 1548 | # define sys_siglist my_sys_siglist | 1548 | # ifdef _sys_siglist |
| 1549 | # define sys_siglist _sys_siglist | ||
| 1550 | # else | ||
| 1551 | # define sys_siglist my_sys_siglist | ||
| 1549 | static char const *sys_siglist[NSIG]; | 1552 | static char const *sys_siglist[NSIG]; |
| 1553 | # endif | ||
| 1554 | #endif | ||
| 1555 | |||
| 1556 | #ifdef _sys_nsig | ||
| 1557 | # define sys_siglist_entries _sys_nsig | ||
| 1558 | #else | ||
| 1559 | # define sys_siglist_entries NSIG | ||
| 1550 | #endif | 1560 | #endif |
| 1551 | 1561 | ||
| 1552 | /* Handle bus errors, invalid instruction, etc. */ | 1562 | /* Handle bus errors, invalid instruction, etc. */ |
| @@ -1609,7 +1619,7 @@ init_signals (bool dumping) | |||
| 1609 | main_thread = pthread_self (); | 1619 | main_thread = pthread_self (); |
| 1610 | #endif | 1620 | #endif |
| 1611 | 1621 | ||
| 1612 | #if !HAVE_DECL_SYS_SIGLIST | 1622 | #if !HAVE_DECL_SYS_SIGLIST && !defined _sys_siglist |
| 1613 | if (! initialized) | 1623 | if (! initialized) |
| 1614 | { | 1624 | { |
| 1615 | sys_siglist[SIGABRT] = "Aborted"; | 1625 | sys_siglist[SIGABRT] = "Aborted"; |
| @@ -1757,7 +1767,7 @@ init_signals (bool dumping) | |||
| 1757 | sys_siglist[SIGXFSZ] = "File size limit exceeded"; | 1767 | sys_siglist[SIGXFSZ] = "File size limit exceeded"; |
| 1758 | # endif | 1768 | # endif |
| 1759 | } | 1769 | } |
| 1760 | #endif /* !HAVE_DECL_SYS_SIGLIST */ | 1770 | #endif /* !HAVE_DECL_SYS_SIGLIST && !_sys_siglist */ |
| 1761 | 1771 | ||
| 1762 | /* Don't alter signal handlers if dumping. On some machines, | 1772 | /* Don't alter signal handlers if dumping. On some machines, |
| 1763 | changing signal handlers sets static data that would make signals | 1773 | changing signal handlers sets static data that would make signals |
| @@ -2285,7 +2295,7 @@ safe_strsignal (int code) | |||
| 2285 | { | 2295 | { |
| 2286 | char const *signame = 0; | 2296 | char const *signame = 0; |
| 2287 | 2297 | ||
| 2288 | if (0 <= code && code < NSIG) | 2298 | if (0 <= code && code < sys_siglist_entries) |
| 2289 | signame = sys_siglist[code]; | 2299 | signame = sys_siglist[code]; |
| 2290 | if (! signame) | 2300 | if (! signame) |
| 2291 | signame = "Unknown signal"; | 2301 | signame = "Unknown signal"; |
diff --git a/src/syssignal.h b/src/syssignal.h index 83ab19698dd..2bf2f046aa5 100644 --- a/src/syssignal.h +++ b/src/syssignal.h | |||
| @@ -43,7 +43,7 @@ extern sigset_t empty_mask; | |||
| 43 | typedef void (*signal_handler_t) (int); | 43 | typedef void (*signal_handler_t) (int); |
| 44 | 44 | ||
| 45 | extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); | 45 | extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); |
| 46 | char const *safe_strsignal (int); | 46 | char const *safe_strsignal (int) ATTRIBUTE_CONST; |
| 47 | 47 | ||
| 48 | #if NSIG < NSIG_MINIMUM | 48 | #if NSIG < NSIG_MINIMUM |
| 49 | # undef NSIG | 49 | # undef NSIG |