aboutsummaryrefslogtreecommitdiffstats
path: root/src/mactoolbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mactoolbox.c')
-rw-r--r--src/mactoolbox.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mactoolbox.c b/src/mactoolbox.c
index f470c517554..58d975742e6 100644
--- a/src/mactoolbox.c
+++ b/src/mactoolbox.c
@@ -570,6 +570,7 @@ mac_handle_text_input_event (next_handler, event, data)
570#ifndef MAC_OSX 570#ifndef MAC_OSX
571 break; 571 break;
572#else /* MAC_OSX */ 572#else /* MAC_OSX */
573 struct buffer *b;
573 CFRange sel_range; 574 CFRange sel_range;
574 int charpos; 575 int charpos;
575 int hpos, vpos, x, y; 576 int hpos, vpos, x, y;
@@ -579,8 +580,17 @@ mac_handle_text_input_event (next_handler, event, data)
579 580
580 f = mac_focus_frame (&one_mac_display_info); 581 f = mac_focus_frame (&one_mac_display_info);
581 w = XWINDOW (f->selected_window); 582 w = XWINDOW (f->selected_window);
583 b = XBUFFER (w->buffer);
584
585 /* Are we in a window whose display is up to date?
586 And verify the buffer's text has not changed. */
587 if (!(EQ (w->window_end_valid, w->buffer)
588 && XINT (w->last_modified) == BUF_MODIFF (b)
589 && XINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)))
590 break;
591
582 mac_get_selected_range (w, &sel_range); 592 mac_get_selected_range (w, &sel_range);
583 charpos = (BUF_BEGV (XBUFFER (w->buffer)) + sel_range.location 593 charpos = (BUF_BEGV (b) + sel_range.location
584 + byte_offset / (long) sizeof (UniChar)); 594 + byte_offset / (long) sizeof (UniChar));
585 595
586 if (!fast_find_position (w, charpos, &hpos, &vpos, &x, &y, Qnil)) 596 if (!fast_find_position (w, charpos, &hpos, &vpos, &x, &y, Qnil))