summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-04-27 09:33:01 +0000
committerChris Wilson <cpwilson@src.gnome.org>2007-04-27 09:33:01 +0000
commit94b939236b9648ff3925260286d888c444d20df8 (patch)
tree7ce6b654aca2ecb51305a06f824c5cfa58503692
parentfdc4e3c5a569e843b08d6e712cea38fe7774a309 (diff)
Bug 433776 – gnome-terminal crashes when open preedit area Take 2.
2007-04-27 Chris Wilson <chris@chris-wilson.co.uk> Bug 433776 – gnome-terminal crashes when open preedit area Take 2. * src/vte.c (vte_terminal_paint): The preedit_cursor is returned by the input modules in characters not in bytes as assumed by the validation. svn path=/trunk/; revision=1887
-rw-r--r--ChangeLog9
-rw-r--r--src/vte.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2071cef..d8954e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
2007-04-27 Chris Wilson <chris@chris-wilson.co.uk>
Bug 433776 – gnome-terminal crashes when open preedit area
+ Take 2.
+
+ * src/vte.c (vte_terminal_paint): The preedit_cursor is returned by
+ the input modules in characters not in bytes as assumed by the
+ validation.
+
+2007-04-27 Chris Wilson <chris@chris-wilson.co.uk>
+
+ Bug 433776 – gnome-terminal crashes when open preedit area
* src/vte.c (vte_terminal_paint): Use the validated cursor index.
diff --git a/src/vte.c b/src/vte.c
index c860dbd..5f49ff7 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -10027,16 +10027,12 @@ draw_cursor_outline:
/* Draw the preedit string, boxed. */
if (len > 0) {
- int preedit_cursor = -1;
struct _vte_draw_text_request *items;
const char *preedit = terminal->pvt->im_preedit;
+ int preedit_cursor;
items = g_new(struct _vte_draw_text_request, len);
for (i = columns = 0; i < len; i++) {
- if ((preedit - terminal->pvt->im_preedit) ==
- terminal->pvt->im_preedit_cursor) {
- preedit_cursor = i;
- }
items[i].c = g_utf8_get_char(preedit);
items[i].columns = _vte_iso2022_unichar_width(items[i].c);
items[i].x = (col + columns) * width;
@@ -10056,7 +10052,8 @@ draw_cursor_outline:
terminal->pvt->im_preedit_attrs,
TRUE,
width, height);
- if (preedit_cursor != -1) {
+ preedit_cursor = terminal->pvt->im_preedit_cursor;
+ if (preedit_cursor >= 0 && preedit_cursor < len) {
/* Cursored letter in reverse. */
vte_terminal_draw_cells(terminal,
&items[preedit_cursor], 1,