fix gtk predit window
This commit is contained in:
@@ -158,7 +158,9 @@ getpreedit(GtkIMContext *ctx, gchar **str, PangoAttrList **attrs,
|
|||||||
PangoAttribute *u;
|
PangoAttribute *u;
|
||||||
|
|
||||||
im = (Im*)ctx;
|
im = (Im*)ctx;
|
||||||
|
if(str)
|
||||||
*str = g_strdup(im->pre);
|
*str = g_strdup(im->pre);
|
||||||
|
if(attrs){
|
||||||
*attrs = pango_attr_list_new();
|
*attrs = pango_attr_list_new();
|
||||||
if(im->prelen > 0){
|
if(im->prelen > 0){
|
||||||
u = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
|
u = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
|
||||||
@@ -166,6 +168,8 @@ getpreedit(GtkIMContext *ctx, gchar **str, PangoAttrList **attrs,
|
|||||||
u->end_index = im->prelen;
|
u->end_index = im->prelen;
|
||||||
pango_attr_list_insert(*attrs, u);
|
pango_attr_list_insert(*attrs, u);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(cursor_pos)
|
||||||
*cursor_pos = g_utf8_strlen(im->pre, -1);
|
*cursor_pos = g_utf8_strlen(im->pre, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user