summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2008-08-20 09:05:50 +0000
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2008-08-20 09:05:50 +0000
commit2aebd8738feddfa5a3af601a095d9d31e1f9d35e (patch)
tree628f8a2a9b6f9390613b681c1abdad08fa207b7c
parent0169e2e18a401a5be744a452f102ae2790efa99d (diff)
downloademacs-2aebd8738feddfa5a3af601a095d9d31e1f9d35e.tar.gz
(mac_handle_text_input_event):
Check if display is up to date before accessing current matrix.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/mactoolbox.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cd2263fa43c..dd1c35f3578 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macterm.c (x_load_font): Round average width to the nearest integer.
+
+ * mactoolbox.c [USE_MAC_TSM] (mac_handle_text_input_event):
+ Check if display is up to date before accessing current matrix.
+
2008-08-15 Chong Yidong <cyd@stupidchicken.com>
* process.c (make_process): Initialize kill_without_query struct
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)
#ifndef MAC_OSX
break;
#else /* MAC_OSX */
+ struct buffer *b;
CFRange sel_range;
int charpos;
int hpos, vpos, x, y;
@@ -579,8 +580,17 @@ mac_handle_text_input_event (next_handler, event, data)
f = mac_focus_frame (&one_mac_display_info);
w = XWINDOW (f->selected_window);
+ b = XBUFFER (w->buffer);
+
+ /* Are we in a window whose display is up to date?
+ And verify the buffer's text has not changed. */
+ if (!(EQ (w->window_end_valid, w->buffer)
+ && XINT (w->last_modified) == BUF_MODIFF (b)
+ && XINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)))
+ break;
+
mac_get_selected_range (w, &sel_range);
- charpos = (BUF_BEGV (XBUFFER (w->buffer)) + sel_range.location
+ charpos = (BUF_BEGV (b) + sel_range.location
+ byte_offset / (long) sizeof (UniChar));
if (!fast_find_position (w, charpos, &hpos, &vpos, &x, &y, Qnil))