Mercurial > emacs
comparison src/mactoolbox.c @ 80741:1f63840526a9
(mac_handle_text_input_event):
Check if display is up to date before accessing current matrix.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Wed, 20 Aug 2008 09:05:31 +0000 |
parents | 557c72d63824 |
children |
comparison
equal
deleted
inserted
replaced
80740:038757cf9434 | 80741:1f63840526a9 |
---|---|
568 else | 568 else |
569 { | 569 { |
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; |
576 struct glyph_row *row; | 577 struct glyph_row *row; |
577 struct glyph *glyph; | 578 struct glyph *glyph; |
578 struct face *face; | 579 struct face *face; |
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)) |
587 { | 597 { |
588 result = errOffsetInvalid; | 598 result = errOffsetInvalid; |