diff options
| author | YAMAMOTO Mitsuharu | 2007-08-09 03:07:26 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-08-09 03:07:26 +0000 |
| commit | 7b7d07bbfa32c89bc1fcb3a829940921106f575a (patch) | |
| tree | acc7bc08252bed6fca5091f67359bba0249c6d41 /src | |
| parent | 72359c326537cd6986b5f6ba9c8833b268d24c93 (diff) | |
| download | emacs-7b7d07bbfa32c89bc1fcb3a829940921106f575a.tar.gz emacs-7b7d07bbfa32c89bc1fcb3a829940921106f575a.zip | |
(frame_highlight, frame_unhighlight): Don't call
ActivateControl/DeactivateControl here.
[USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when
frame-notice-user-settings is non-nil.
[USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter
for kEventParamFMFontStyle.
[TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check
mac_pass_command_to_system and mac_pass_control_to_system here.
(XTread_socket): Call ActivateControl/DeactivateControl here.
(XTread_socket) [TARGET_API_MAC_CARBON]:
Check mac_pass_command_to_system and mac_pass_control_to_system here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 20 | ||||
| -rw-r--r-- | src/macterm.c | 95 |
2 files changed, 67 insertions, 48 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 09631c23e61..e07c4696c9e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2007-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * gmalloc.c (posix_memalign): New function. | ||
| 4 | |||
| 5 | * macterm.c (frame_highlight, frame_unhighlight): Don't call | ||
| 6 | ActivateControl/DeactivateControl here. | ||
| 7 | [USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when | ||
| 8 | frame-notice-user-settings is non-nil. | ||
| 9 | [USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter | ||
| 10 | for kEventParamFMFontStyle. | ||
| 11 | [TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check | ||
| 12 | mac_pass_command_to_system and mac_pass_control_to_system here. | ||
| 13 | (XTread_socket): Call ActivateControl/DeactivateControl here. | ||
| 14 | (XTread_socket) [TARGET_API_MAC_CARBON]: | ||
| 15 | Check mac_pass_command_to_system and mac_pass_control_to_system here. | ||
| 16 | |||
| 1 | 2007-08-07 Chong Yidong <cyd@stupidchicken.com> | 17 | 2007-08-07 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 18 | ||
| 3 | * xdisp.c (move_it_by_lines): Remove incorrect optimization. | 19 | * xdisp.c (move_it_by_lines): Remove incorrect optimization. |
| @@ -20,8 +36,8 @@ | |||
| 20 | Call malloc_enable_thread on interactive startup. | 36 | Call malloc_enable_thread on interactive startup. |
| 21 | 37 | ||
| 22 | * gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable. | 38 | * gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable. |
| 23 | [USE_PTHREAD] (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS) | 39 | (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS) |
| 24 | (UNLOCK_ALIGNED_BLOCKS): Conditionalize with it. | 40 | [USE_PTHREAD]: Conditionalize with it. |
| 25 | (malloc_atfork_handler_prepare, malloc_atfork_handler_parent) | 41 | (malloc_atfork_handler_prepare, malloc_atfork_handler_parent) |
| 26 | (malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]: | 42 | (malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]: |
| 27 | New functions. | 43 | New functions. |
diff --git a/src/macterm.c b/src/macterm.c index 1fd4ee308b1..d1d9205d5dc 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -4334,14 +4334,6 @@ static void | |||
| 4334 | frame_highlight (f) | 4334 | frame_highlight (f) |
| 4335 | struct frame *f; | 4335 | struct frame *f; |
| 4336 | { | 4336 | { |
| 4337 | OSErr err; | ||
| 4338 | ControlRef root_control; | ||
| 4339 | |||
| 4340 | BLOCK_INPUT; | ||
| 4341 | err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control); | ||
| 4342 | if (err == noErr) | ||
| 4343 | ActivateControl (root_control); | ||
| 4344 | UNBLOCK_INPUT; | ||
| 4345 | x_update_cursor (f, 1); | 4337 | x_update_cursor (f, 1); |
| 4346 | } | 4338 | } |
| 4347 | 4339 | ||
| @@ -4349,14 +4341,6 @@ static void | |||
| 4349 | frame_unhighlight (f) | 4341 | frame_unhighlight (f) |
| 4350 | struct frame *f; | 4342 | struct frame *f; |
| 4351 | { | 4343 | { |
| 4352 | OSErr err; | ||
| 4353 | ControlRef root_control; | ||
| 4354 | |||
| 4355 | BLOCK_INPUT; | ||
| 4356 | err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control); | ||
| 4357 | if (err == noErr) | ||
| 4358 | DeactivateControl (root_control); | ||
| 4359 | UNBLOCK_INPUT; | ||
| 4360 | x_update_cursor (f, 1); | 4344 | x_update_cursor (f, 1); |
| 4361 | } | 4345 | } |
| 4362 | 4346 | ||
| @@ -6114,7 +6098,9 @@ free_frame_tool_bar (f) | |||
| 6114 | 6098 | ||
| 6115 | BLOCK_INPUT; | 6099 | BLOCK_INPUT; |
| 6116 | ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false, | 6100 | ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false, |
| 6117 | f == mac_focus_frame (dpyinfo)); | 6101 | (NILP (Fsymbol_value |
| 6102 | (intern ("frame-notice-user-settings"))) | ||
| 6103 | && f == mac_focus_frame (dpyinfo))); | ||
| 6118 | /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events | 6104 | /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events |
| 6119 | on toolbar visibility change. */ | 6105 | on toolbar visibility change. */ |
| 6120 | mac_handle_origin_change (f); | 6106 | mac_handle_origin_change (f); |
| @@ -9391,11 +9377,13 @@ mac_handle_font_event (next_handler, event, data) | |||
| 9391 | static const EventParamName names_sel[] = {kEventParamATSUFontID, | 9377 | static const EventParamName names_sel[] = {kEventParamATSUFontID, |
| 9392 | kEventParamATSUFontSize, | 9378 | kEventParamATSUFontSize, |
| 9393 | kEventParamFMFontFamily, | 9379 | kEventParamFMFontFamily, |
| 9380 | kEventParamFMFontStyle, | ||
| 9394 | kEventParamFMFontSize, | 9381 | kEventParamFMFontSize, |
| 9395 | kEventParamFontColor}; | 9382 | kEventParamFontColor}; |
| 9396 | static const EventParamType types_sel[] = {typeATSUFontID, | 9383 | static const EventParamType types_sel[] = {typeATSUFontID, |
| 9397 | typeATSUSize, | 9384 | typeATSUSize, |
| 9398 | typeFMFontFamily, | 9385 | typeFMFontFamily, |
| 9386 | typeFMFontStyle, | ||
| 9399 | typeFMFontSize, | 9387 | typeFMFontSize, |
| 9400 | typeFontColor}; | 9388 | typeFontColor}; |
| 9401 | 9389 | ||
| @@ -10957,7 +10945,7 @@ mac_handle_keyboard_event (next_handler, event, data) | |||
| 10957 | void *data; | 10945 | void *data; |
| 10958 | { | 10946 | { |
| 10959 | OSStatus err, result = eventNotHandledErr; | 10947 | OSStatus err, result = eventNotHandledErr; |
| 10960 | UInt32 event_kind, key_code, modifiers, mapped_modifiers; | 10948 | UInt32 event_kind, key_code, modifiers; |
| 10961 | unsigned char char_code; | 10949 | unsigned char char_code; |
| 10962 | 10950 | ||
| 10963 | event_kind = GetEventKind (event); | 10951 | event_kind = GetEventKind (event); |
| @@ -10966,32 +10954,16 @@ mac_handle_keyboard_event (next_handler, event, data) | |||
| 10966 | case kEventRawKeyDown: | 10954 | case kEventRawKeyDown: |
| 10967 | case kEventRawKeyRepeat: | 10955 | case kEventRawKeyRepeat: |
| 10968 | case kEventRawKeyUp: | 10956 | case kEventRawKeyUp: |
| 10969 | if (read_socket_inev == NULL) | ||
| 10970 | { | ||
| 10971 | result = CallNextEventHandler (next_handler, event); | ||
| 10972 | break; | ||
| 10973 | } | ||
| 10974 | |||
| 10975 | err = GetEventParameter (event, kEventParamKeyModifiers, | ||
| 10976 | typeUInt32, NULL, | ||
| 10977 | sizeof (UInt32), NULL, &modifiers); | ||
| 10978 | if (err != noErr) | ||
| 10979 | break; | ||
| 10980 | |||
| 10981 | mapped_modifiers = mac_mapped_modifiers (modifiers); | ||
| 10982 | |||
| 10983 | /* When using Carbon Events, we need to pass raw keyboard events | 10957 | /* When using Carbon Events, we need to pass raw keyboard events |
| 10984 | to the TSM ourselves. If TSM handles it, it will pass back | 10958 | to the TSM ourselves. If TSM handles it, it will pass back |
| 10985 | noErr, otherwise it will pass back "eventNotHandledErr" and | 10959 | noErr, otherwise it will pass back "eventNotHandledErr" and |
| 10986 | we can process it normally. */ | 10960 | we can process it normally. */ |
| 10987 | if (!(mapped_modifiers | 10961 | result = CallNextEventHandler (next_handler, event); |
| 10988 | & ~(mac_pass_command_to_system ? cmdKey : 0) | 10962 | if (result != eventNotHandledErr) |
| 10989 | & ~(mac_pass_control_to_system ? controlKey : 0))) | 10963 | break; |
| 10990 | { | 10964 | |
| 10991 | result = CallNextEventHandler (next_handler, event); | 10965 | if (read_socket_inev == NULL) |
| 10992 | if (result != eventNotHandledErr) | 10966 | break; |
| 10993 | break; | ||
| 10994 | } | ||
| 10995 | 10967 | ||
| 10996 | #if USE_MAC_TSM | 10968 | #if USE_MAC_TSM |
| 10997 | if (read_socket_inev->kind != NO_EVENT) | 10969 | if (read_socket_inev->kind != NO_EVENT) |
| @@ -11016,6 +10988,12 @@ mac_handle_keyboard_event (next_handler, event, data) | |||
| 11016 | if (err != noErr) | 10988 | if (err != noErr) |
| 11017 | break; | 10989 | break; |
| 11018 | 10990 | ||
| 10991 | err = GetEventParameter (event, kEventParamKeyModifiers, | ||
| 10992 | typeUInt32, NULL, | ||
| 10993 | sizeof (UInt32), NULL, &modifiers); | ||
| 10994 | if (err != noErr) | ||
| 10995 | break; | ||
| 10996 | |||
| 11019 | do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey), | 10997 | do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey), |
| 11020 | char_code, key_code, modifiers, | 10998 | char_code, key_code, modifiers, |
| 11021 | ((unsigned long) | 10999 | ((unsigned long) |
| @@ -12197,6 +12175,8 @@ XTread_socket (sd, expected, hold_quit) | |||
| 12197 | case activateEvt: | 12175 | case activateEvt: |
| 12198 | { | 12176 | { |
| 12199 | WindowRef window_ptr = (WindowRef) er.message; | 12177 | WindowRef window_ptr = (WindowRef) er.message; |
| 12178 | OSErr err; | ||
| 12179 | ControlRef root_control; | ||
| 12200 | 12180 | ||
| 12201 | if (window_ptr == tip_window) | 12181 | if (window_ptr == tip_window) |
| 12202 | { | 12182 | { |
| @@ -12214,6 +12194,10 @@ XTread_socket (sd, expected, hold_quit) | |||
| 12214 | /* A window has been activated */ | 12194 | /* A window has been activated */ |
| 12215 | Point mouse_loc; | 12195 | Point mouse_loc; |
| 12216 | 12196 | ||
| 12197 | err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control); | ||
| 12198 | if (err == noErr) | ||
| 12199 | ActivateControl (root_control); | ||
| 12200 | |||
| 12217 | x_detect_focus_change (dpyinfo, &er, &inev); | 12201 | x_detect_focus_change (dpyinfo, &er, &inev); |
| 12218 | 12202 | ||
| 12219 | mouse_loc.h = (er.where.h | 12203 | mouse_loc.h = (er.where.h |
| @@ -12229,6 +12213,10 @@ XTread_socket (sd, expected, hold_quit) | |||
| 12229 | else | 12213 | else |
| 12230 | { | 12214 | { |
| 12231 | /* A window has been deactivated */ | 12215 | /* A window has been deactivated */ |
| 12216 | err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control); | ||
| 12217 | if (err == noErr) | ||
| 12218 | DeactivateControl (root_control); | ||
| 12219 | |||
| 12232 | #ifdef USE_TOOLKIT_SCROLL_BARS | 12220 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 12233 | if (dpyinfo->grabbed && tracked_scroll_bar) | 12221 | if (dpyinfo->grabbed && tracked_scroll_bar) |
| 12234 | { | 12222 | { |
| @@ -12284,13 +12272,29 @@ XTread_socket (sd, expected, hold_quit) | |||
| 12284 | clear_mouse_face (dpyinfo); | 12272 | clear_mouse_face (dpyinfo); |
| 12285 | dpyinfo->mouse_face_hidden = 1; | 12273 | dpyinfo->mouse_face_hidden = 1; |
| 12286 | } | 12274 | } |
| 12275 | |||
| 12276 | { | ||
| 12277 | UInt32 modifiers = er.modifiers, mapped_modifiers; | ||
| 12278 | |||
| 12279 | #ifdef MAC_OSX | ||
| 12280 | GetEventParameter (eventRef, kEventParamKeyModifiers, | ||
| 12281 | typeUInt32, NULL, | ||
| 12282 | sizeof (UInt32), NULL, &modifiers); | ||
| 12283 | #endif | ||
| 12284 | mapped_modifiers = mac_mapped_modifiers (modifiers); | ||
| 12285 | |||
| 12287 | #if TARGET_API_MAC_CARBON | 12286 | #if TARGET_API_MAC_CARBON |
| 12288 | goto OTHER; | 12287 | if (!(mapped_modifiers |
| 12289 | #else | 12288 | & ~(mac_pass_command_to_system ? cmdKey : 0) |
| 12290 | do_keystroke (er.what, er.message & charCodeMask, | 12289 | & ~(mac_pass_control_to_system ? controlKey : 0))) |
| 12291 | (er.message & keyCodeMask) >> 8, | 12290 | goto OTHER; |
| 12292 | er.modifiers, timestamp, &inev); | 12291 | else |
| 12293 | #endif | 12292 | #endif |
| 12293 | if (er.what != keyUp) | ||
| 12294 | do_keystroke (er.what, er.message & charCodeMask, | ||
| 12295 | (er.message & keyCodeMask) >> 8, | ||
| 12296 | modifiers, timestamp, &inev); | ||
| 12297 | } | ||
| 12294 | break; | 12298 | break; |
| 12295 | 12299 | ||
| 12296 | case kHighLevelEvent: | 12300 | case kHighLevelEvent: |
| @@ -12344,7 +12348,6 @@ XTread_socket (sd, expected, hold_quit) | |||
| 12344 | } | 12348 | } |
| 12345 | count++; | 12349 | count++; |
| 12346 | } | 12350 | } |
| 12347 | |||
| 12348 | } | 12351 | } |
| 12349 | 12352 | ||
| 12350 | /* If the focus was just given to an autoraising frame, | 12353 | /* If the focus was just given to an autoraising frame, |