+2007-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * gmalloc.c (posix_memalign): New function.
+
+ * macterm.c (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.
+
2007-08-07 Chong Yidong <cyd@stupidchicken.com>
* xdisp.c (move_it_by_lines): Remove incorrect optimization.
Call malloc_enable_thread on interactive startup.
* gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable.
- [USE_PTHREAD] (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS)
- (UNLOCK_ALIGNED_BLOCKS): Conditionalize with it.
+ (LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS)
+ [USE_PTHREAD]: Conditionalize with it.
(malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
(malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]:
New functions.
frame_highlight (f)
struct frame *f;
{
- OSErr err;
- ControlRef root_control;
-
- BLOCK_INPUT;
- err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
- if (err == noErr)
- ActivateControl (root_control);
- UNBLOCK_INPUT;
x_update_cursor (f, 1);
}
frame_unhighlight (f)
struct frame *f;
{
- OSErr err;
- ControlRef root_control;
-
- BLOCK_INPUT;
- err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
- if (err == noErr)
- DeactivateControl (root_control);
- UNBLOCK_INPUT;
x_update_cursor (f, 1);
}
BLOCK_INPUT;
ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false,
- f == mac_focus_frame (dpyinfo));
+ (NILP (Fsymbol_value
+ (intern ("frame-notice-user-settings")))
+ && f == mac_focus_frame (dpyinfo)));
/* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events
on toolbar visibility change. */
mac_handle_origin_change (f);
static const EventParamName names_sel[] = {kEventParamATSUFontID,
kEventParamATSUFontSize,
kEventParamFMFontFamily,
+ kEventParamFMFontStyle,
kEventParamFMFontSize,
kEventParamFontColor};
static const EventParamType types_sel[] = {typeATSUFontID,
typeATSUSize,
typeFMFontFamily,
+ typeFMFontStyle,
typeFMFontSize,
typeFontColor};
void *data;
{
OSStatus err, result = eventNotHandledErr;
- UInt32 event_kind, key_code, modifiers, mapped_modifiers;
+ UInt32 event_kind, key_code, modifiers;
unsigned char char_code;
event_kind = GetEventKind (event);
case kEventRawKeyDown:
case kEventRawKeyRepeat:
case kEventRawKeyUp:
- if (read_socket_inev == NULL)
- {
- result = CallNextEventHandler (next_handler, event);
- break;
- }
-
- err = GetEventParameter (event, kEventParamKeyModifiers,
- typeUInt32, NULL,
- sizeof (UInt32), NULL, &modifiers);
- if (err != noErr)
- break;
-
- mapped_modifiers = mac_mapped_modifiers (modifiers);
-
/* When using Carbon Events, we need to pass raw keyboard events
to the TSM ourselves. If TSM handles it, it will pass back
noErr, otherwise it will pass back "eventNotHandledErr" and
we can process it normally. */
- if (!(mapped_modifiers
- & ~(mac_pass_command_to_system ? cmdKey : 0)
- & ~(mac_pass_control_to_system ? controlKey : 0)))
- {
- result = CallNextEventHandler (next_handler, event);
- if (result != eventNotHandledErr)
- break;
- }
+ result = CallNextEventHandler (next_handler, event);
+ if (result != eventNotHandledErr)
+ break;
+
+ if (read_socket_inev == NULL)
+ break;
#if USE_MAC_TSM
if (read_socket_inev->kind != NO_EVENT)
if (err != noErr)
break;
+ err = GetEventParameter (event, kEventParamKeyModifiers,
+ typeUInt32, NULL,
+ sizeof (UInt32), NULL, &modifiers);
+ if (err != noErr)
+ break;
+
do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey),
char_code, key_code, modifiers,
((unsigned long)
case activateEvt:
{
WindowRef window_ptr = (WindowRef) er.message;
+ OSErr err;
+ ControlRef root_control;
if (window_ptr == tip_window)
{
/* A window has been activated */
Point mouse_loc;
+ err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+ if (err == noErr)
+ ActivateControl (root_control);
+
x_detect_focus_change (dpyinfo, &er, &inev);
mouse_loc.h = (er.where.h
else
{
/* A window has been deactivated */
+ err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+ if (err == noErr)
+ DeactivateControl (root_control);
+
#ifdef USE_TOOLKIT_SCROLL_BARS
if (dpyinfo->grabbed && tracked_scroll_bar)
{
clear_mouse_face (dpyinfo);
dpyinfo->mouse_face_hidden = 1;
}
+
+ {
+ UInt32 modifiers = er.modifiers, mapped_modifiers;
+
+#ifdef MAC_OSX
+ GetEventParameter (eventRef, kEventParamKeyModifiers,
+ typeUInt32, NULL,
+ sizeof (UInt32), NULL, &modifiers);
+#endif
+ mapped_modifiers = mac_mapped_modifiers (modifiers);
+
#if TARGET_API_MAC_CARBON
- goto OTHER;
-#else
- do_keystroke (er.what, er.message & charCodeMask,
- (er.message & keyCodeMask) >> 8,
- er.modifiers, timestamp, &inev);
+ if (!(mapped_modifiers
+ & ~(mac_pass_command_to_system ? cmdKey : 0)
+ & ~(mac_pass_control_to_system ? controlKey : 0)))
+ goto OTHER;
+ else
#endif
+ if (er.what != keyUp)
+ do_keystroke (er.what, er.message & charCodeMask,
+ (er.message & keyCodeMask) >> 8,
+ modifiers, timestamp, &inev);
+ }
break;
case kHighLevelEvent:
}
count++;
}
-
}
/* If the focus was just given to an autoraising frame,