Lines 124-130
struct _ClipboardContents {
Link Here
|
124 |
}; |
124 |
}; |
125 |
|
125 |
|
126 |
#define d_s(x) |
126 |
#define d_s(x) |
127 |
#define D_IM(x) |
127 |
#define D_IM(x) x |
128 |
|
128 |
|
129 |
static GtkLayoutClass *parent_class = NULL; |
129 |
static GtkLayoutClass *parent_class = NULL; |
130 |
|
130 |
|
Lines 3213-3218
gtk_html_im_commit_cb (GtkIMContext *context, const gchar *str, GtkHTML *html)
Link Here
|
3213 |
html_undo_thaw (html->engine->undo); |
3213 |
html_undo_thaw (html->engine->undo); |
3214 |
} |
3214 |
} |
3215 |
|
3215 |
|
|
|
3216 |
/* Let cursor jump back when im_preedit starts */ |
3217 |
html_cursor_exactly_jump_to_position_no_spell (html->engine->cursor, html->engine, |
3218 |
html->engine->cursor->position - |
3219 |
html->priv->im_cumulative_cursor_move); |
3220 |
html->priv->im_cumulative_cursor_move = 0; |
3221 |
|
3216 |
pos = html->engine->cursor->position; |
3222 |
pos = html->engine->cursor->position; |
3217 |
if (html->engine->mark && html->engine->mark->position > pos) |
3223 |
if (html->engine->mark && html->engine->mark->position > pos) |
3218 |
pos = html->engine->mark->position; |
3224 |
pos = html->engine->mark->position; |
Lines 3230-3235
static void
Link Here
|
3230 |
gtk_html_im_preedit_start_cb (GtkIMContext *context, GtkHTML *html) |
3236 |
gtk_html_im_preedit_start_cb (GtkIMContext *context, GtkHTML *html) |
3231 |
{ |
3237 |
{ |
3232 |
html->priv->im_pre_len = 0; |
3238 |
html->priv->im_pre_len = 0; |
|
|
3239 |
html->priv->im_cumulative_cursor_move = 0; |
3233 |
} |
3240 |
} |
3234 |
|
3241 |
|
3235 |
static void |
3242 |
static void |
Lines 3277-3282
gtk_html_im_preedit_changed_cb (GtkIMContext *context, GtkHTML *html)
Link Here
|
3277 |
html->priv->im_orig_style = html_engine_get_font_style (html->engine); |
3284 |
html->priv->im_orig_style = html_engine_get_font_style (html->engine); |
3278 |
|
3285 |
|
3279 |
gtk_im_context_get_preedit_string (html->priv->im_context, &preedit_string, &attrs, &cursor_pos); |
3286 |
gtk_im_context_get_preedit_string (html->priv->im_context, &preedit_string, &attrs, &cursor_pos); |
|
|
3287 |
html->priv->im_cumulative_cursor_move += cursor_pos; |
3280 |
|
3288 |
|
3281 |
D_IM (printf ("IM preedit changed to %s\n", preedit_string);) |
3289 |
D_IM (printf ("IM preedit changed to %s\n", preedit_string);) |
3282 |
html->priv->im_pre_len = g_utf8_strlen (preedit_string, -1); |
3290 |
html->priv->im_pre_len = g_utf8_strlen (preedit_string, -1); |
Lines 3450-3455
gtk_html_init (GtkHTML* html)
Link Here
|
3450 |
html->priv->need_im_reset = FALSE; |
3458 |
html->priv->need_im_reset = FALSE; |
3451 |
html->priv->im_block_reset = FALSE; |
3459 |
html->priv->im_block_reset = FALSE; |
3452 |
html->priv->im_pre_len = 0; |
3460 |
html->priv->im_pre_len = 0; |
|
|
3461 |
html->priv->im_cumulative_cursor_move = 0; |
3453 |
|
3462 |
|
3454 |
g_signal_connect (G_OBJECT (html->priv->im_context), "commit", |
3463 |
g_signal_connect (G_OBJECT (html->priv->im_context), "commit", |
3455 |
G_CALLBACK (gtk_html_im_commit_cb), html); |
3464 |
G_CALLBACK (gtk_html_im_commit_cb), html); |