* src/androidterm.c (android_get_selection): Use ephemeral last
point.
* src/textconv.c (report_selected_window_change): Set
w->ephemeral_last_point to the window's point now.
/* Return W's point at the time of the last redisplay. This is
rather important to keep the input method consistent with the
contents of the display. */
- context->point = w->last_point;
+ context->point = w->ephemeral_last_point;
}
}
void
report_selected_window_change (struct frame *f)
{
+ struct window *w;
+
reset_frame_state (f);
if (!text_interface)
return;
+ /* When called from window.c, F's selected window has already been
+ redisplayed, but w->last_point has not yet been updated. Update
+ it here to avoid race conditions when the IM asks for the initial
+ selection position immediately after. */
+
+ if (WINDOWP (f->selected_window))
+ {
+ w = XWINDOW (f->selected_window);
+ w->ephemeral_last_point = window_point (w);
+ }
+
text_interface->reset (f);
}