fix gtk predit window

This commit is contained in:
2026-05-29 02:28:49 +09:00
parent 7e69827c13
commit f686edd198
2 changed files with 13 additions and 10 deletions

View File

@@ -158,7 +158,9 @@ getpreedit(GtkIMContext *ctx, gchar **str, PangoAttrList **attrs,
PangoAttribute *u;
im = (Im*)ctx;
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);
@@ -166,6 +168,8 @@ getpreedit(GtkIMContext *ctx, gchar **str, PangoAttrList **attrs,
u->end_index = im->prelen;
pango_attr_list_insert(*attrs, u);
}
}
if(cursor_pos)
*cursor_pos = g_utf8_strlen(im->pre, -1);
}

3
run.sh
View File

@@ -1,8 +1,7 @@
#!/bin/sh
cd "$(dirname "$0")"
pkill strans
pkill strans-xim
sleep 1
./strans map font &
sleep 1