Commit a56dd283 authored by YAMAMOTO Mitsuharu's avatar YAMAMOTO Mitsuharu
Browse files

[USE_MAC_TSM] (mac_handle_text_input_event):

Check WINDOWP before using XWINDOW.  Consolidate return statements.
parent dd8d430f
2007-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
Check WINDOWP before using XWINDOW. Consolidate return statements.
2007-06-27 Richard Stallman <rms@gnu.org>
 
* fileio.c (syms_of_fileio) <after-insert-file-functions>: Doc fix.
......
......@@ -11164,7 +11164,7 @@ mac_handle_text_input_event (next_handler, event, data)
EventRef event;
void *data;
{
OSStatus result, err = noErr;
OSStatus err, result;
Lisp_Object id_key = Qnil;
int num_params;
const EventParamName *names;
......@@ -11225,6 +11225,7 @@ mac_handle_text_input_event (next_handler, event, data)
SetEventParameter (event, EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER,
typeUInt32, sizeof (UInt32), &seqno_uaia);
seqno_uaia++;
result = noErr;
break;
case kEventTextInputUnicodeForKeyEvent:
......@@ -11242,7 +11243,7 @@ mac_handle_text_input_event (next_handler, event, data)
if (err == noErr && mac_mapped_modifiers (modifiers))
/* There're mapped modifier keys. Process it in
do_keystroke. */
return eventNotHandledErr;
break;
if (err == noErr)
err = GetEventParameter (kbd_event, kEventParamKeyUnicodes,
typeUnicodeText, NULL, 0, &actual_size,
......@@ -11281,16 +11282,20 @@ mac_handle_text_input_event (next_handler, event, data)
XSETFRAME (read_socket_inev->frame_or_window, f);
}
}
return eventNotHandledErr;
break;
}
}
if (err == noErr)
{
/* Non-ASCII keystrokes without mapped modifiers are
processed at the Lisp level. */
id_key = Qunicode_for_key_event;
num_params = sizeof (names_ufke) / sizeof (names_ufke[0]);
names = names_ufke;
types = types_ufke;
result = noErr;
}
}
/* Non-ASCII keystrokes without mapped modifiers are processed
at the Lisp level. */
id_key = Qunicode_for_key_event;
num_params = sizeof (names_ufke) / sizeof (names_ufke[0]);
names = names_ufke;
types = types_ufke;
break;
case kEventTextInputOffsetToPos:
......@@ -11300,22 +11305,24 @@ mac_handle_text_input_event (next_handler, event, data)
Point p;
if (!OVERLAYP (Vmac_ts_active_input_overlay))
return eventNotHandledErr;
break;
/* Strictly speaking, this is not always correct because
previous events may change some states about display. */
if (NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string)))
if (!NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string)))
{
/* Active input area is displayed around the current point. */
f = SELECTED_FRAME ();
w = XWINDOW (f->selected_window);
}
else if (WINDOWP (echo_area_window))
{
/* Active input area is displayed in the echo area. */
w = XWINDOW (echo_area_window);
f = WINDOW_XFRAME (w);
}
else
{
/* Active input area is displayed around the current point. */
f = SELECTED_FRAME ();
w = XWINDOW (f->selected_window);
}
break;
p.h = (WINDOW_TO_FRAME_PIXEL_X (w, w->cursor.x)
+ WINDOW_LEFT_FRINGE_WIDTH (w)
......@@ -11325,6 +11332,8 @@ mac_handle_text_input_event (next_handler, event, data)
+ f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f));
err = SetEventParameter (event, kEventParamTextInputReplyPoint,
typeQDPoint, sizeof (typeQDPoint), &p);
if (err == noErr)
result = noErr;
}
break;
......@@ -11336,9 +11345,6 @@ mac_handle_text_input_event (next_handler, event, data)
err = mac_store_event_ref_as_apple_event (0, 0, Qtext_input, id_key,
event, num_params,
names, types);
if (err == noErr)
result = noErr;
return result;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment