fix gtk predit window
This commit is contained in:
20
gtk/main.c
20
gtk/main.c
@@ -158,15 +158,19 @@ getpreedit(GtkIMContext *ctx, gchar **str, PangoAttrList **attrs,
|
||||
PangoAttribute *u;
|
||||
|
||||
im = (Im*)ctx;
|
||||
*str = g_strdup(im->pre);
|
||||
*attrs = pango_attr_list_new();
|
||||
if(im->prelen > 0){
|
||||
u = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
|
||||
u->start_index = 0;
|
||||
u->end_index = im->prelen;
|
||||
pango_attr_list_insert(*attrs, u);
|
||||
if(str)
|
||||
*str = g_strdup(im->pre);
|
||||
if(attrs){
|
||||
*attrs = pango_attr_list_new();
|
||||
if(im->prelen > 0){
|
||||
u = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
|
||||
u->start_index = 0;
|
||||
u->end_index = im->prelen;
|
||||
pango_attr_list_insert(*attrs, u);
|
||||
}
|
||||
}
|
||||
*cursor_pos = g_utf8_strlen(im->pre, -1);
|
||||
if(cursor_pos)
|
||||
*cursor_pos = g_utf8_strlen(im->pre, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user