Skip to content
Myr

wayland: implement text-input-unstable-v3 for IME support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Adds IME input method support (fcitx5, ibus, etc.) using the text-input-unstable-v3 Wayland protocol, following the approach used by foot and rofi. Closes #615

authored by Mark Stosberg · committed by Daniel Eklöf · parent b320e2f · Browse files · 8 files+492 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

8 files+492 added−12 removed

  • other:+492 added−12 removed

8 files+492 added−12 removed

modified:doc/fuzzel.1.scd+5 added
641 unmodified lines
642643Fuzzel uses the localized strings from the .desktop files by644default. To disable this, run fuzzel with *LC_MESSAGES=C*.645646# IME647648Fuzzel supports input method editors (IME) via the649*text-input-unstable-v3* Wayland protocol.650651# FONT FORMAT652653The font is specified in FontConfig syntax. That is, a colon-separated654list of font name and font options.
35 unmodified lines
modified:CHANGELOG.md+3 added
36 unmodified lines
37### Added3839* `--override` command line option, allowing you to override **all**40 options available in `fuzzel.ini` ([#759][759]).41* IME support, via the `text-input-unstable-v3` Wayland protocol42 ([#615][614]).4344[759]: https://codeberg.org/dnkl/fuzzel/issues/75945[615]: https://codeberg.org/dnkl/fuzzel/issues/615464748### Changed49
1173 unmodified lines
modified:meson.build+1 added
151 unmodified lines
152 wayland_protocols_datadir + '/staging/fractional-scale/fractional-scale-v1.xml',153 wayland_protocols_datadir / 'unstable/primary-selection/primary-selection-unstable-v1.xml',154 wayland_protocols_datadir / 'staging/color-management/color-management-v1.xml',155 wayland_protocols_datadir / 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml',156 wayland_protocols_datadir / 'unstable/text-input/text-input-unstable-v3.xml',157]158159foreach prot : wl_proto_xml160 wl_proto_headers += custom_target(
118 unmodified lines
modified:README.md+2 added-1 removed
modified:render.c+118 added-9 removed
99 unmodified lines
100 unsigned message_height;101102 unsigned input_glyph_offset; /* At which glyph to start rendering input */103104 /* Set during render_prompt; used by IME for cursor rectangle */105 struct {106 int x, y, w, h; /* buffer pixel coordinates */107 } cursor_rect;108109 struct {110 uint16_t count;111 sem_t start;112 sem_t done;113 mtx_t lock;
633 unmodified lines
747 else if (message_run != render->message_text_run)748 fcft_text_run_destroy(message_run);749}750751static void752update_cursor_rect(struct render *render, int x, int y)753{754 struct fcft_font *font = render->font;755 const int height = min(font->ascent + font->descent, render->row_height);756 render->cursor_rect.x = x;757 render->cursor_rect.y = y + font->descent - height;758 render->cursor_rect.w = font->underline.thickness;759 render->cursor_rect.h = height;760}761762/*763 * Render preedit text at the cursor position, following foot's approach:764 * - All preedit glyphs are rendered with an underline.765 * - A bar cursor is placed at the glyph index given by preedit_cursor766 * (-1 means the cursor is hidden).767 * Returns the new x position after all preedit glyphs.768 */769static int770render_preedit_at_cursor(const struct render *render, struct buffer *buf,771 int x, int y, int max_x,772 const char32_t *preedit, size_t preedit_len,773 int32_t preedit_cursor,774 enum fcft_subpixel subpixel)775{776 struct fcft_font *font = render->font;777 const int ul_y = y - font->underline.position;778 const int ul_h = font->underline.thickness;779780 char32_t prev = 0;781782 for (size_t i = 0; i < preedit_len; i++) {783 /* Cursor bar before this glyph */784 if (preedit_cursor >= 0 && (int32_t)i == preedit_cursor)785 render_cursor(render, x, y, buf->pix[0]);786787 const struct fcft_glyph *glyph =788 fcft_rasterize_char_utf32(font, preedit[i], subpixel);789790 if (glyph == NULL) {791 prev = 0;792 continue;793 }794795 long x_kern = 0;796 if (prev != 0)797 fcft_kerning(font, prev, preedit[i], &x_kern, NULL);798 x += x_kern;799800 const int pixels_needed = max(glyph->x + glyph->width, glyph->advance.x);801 if (x + pixels_needed > max_x)802 break;803804 const int glyph_start_x = x;805806 render_glyph(buf->pix[0], glyph, x, y, &render->pix_input_color);807 x += glyph->advance.x;808 x += pt_or_px_as_pixels(render, &render->conf->letter_spacing);809810 /* Underline below the preedit glyph */811 pixman_image_fill_rectangles(812 PIXMAN_OP_SRC, buf->pix[0], &render->pix_input_color,813 1, &(pixman_rectangle16_t){814 glyph_start_x,815 ul_y,816 x - glyph_start_x,817 ul_h});818819 prev = preedit[i];820 }821822 /* Cursor bar after all preedit glyphs */823 if (preedit_cursor < 0 || preedit_cursor >= (int32_t)preedit_len)824 render_cursor(render, x, y, buf->pix[0]);825826 return x;827}828829void830render_prompt(struct render *render, struct buffer *buf,748 const struct prompt *prompt, const struct matches *matches)831 const struct prompt *prompt, const struct matches *matches,832 const char32_t *preedit, int32_t preedit_cursor)833{834 struct fcft_font *font = render->font;835 assert(font != NULL);836
4 unmodified lines
841 const size_t cursor_location = prompt_cursor(prompt);842843 const char32_t *ptext = prompt_text(prompt);844 size_t text_len = c32len(ptext);845 /* Suppress placeholder while IME preedit is active */846 const bool have_preedit = preedit != NULL && preedit[0] != U'\0';761 bool use_placeholder = text_len == 0;847 bool use_placeholder = text_len == 0 && !have_preedit;848849 const enum fcft_subpixel subpixel =850 (render->conf->colors.background.a == 1. &&851 render->conf->colors.selection.a == 1.)
117 unmodified lines
969 input_glyphs, input_kerning, x, max_x);970971 /* Cursor, if right after the prompt. In all other cases, the972 * cursor will be rendered by the loop below */887 if (cursor_location == render->input_glyph_offset888 || (conf->password_mode.enabled &&889 conf->password_mode.character == U'\0'))890 {891 render_cursor(render, x, y, buf->pix[0]);973 const bool is_hidden_pwd =974 conf->password_mode.enabled && conf->password_mode.character == U'\0';975 if (cursor_location == render->input_glyph_offset || is_hidden_pwd) {976 update_cursor_rect(render, x, y);977 if (have_preedit && !is_hidden_pwd) {978 x = render_preedit_at_cursor(979 render, buf, x, y, max_x,980 preedit, c32len(preedit), preedit_cursor, subpixel);981 } else {982 render_cursor(render, x, y, buf->pix[0]);983 }984 }985986 if (input_run != NULL && !(conf->password_mode.enabled && !use_placeholder)) {987 /* We only shape the placeholder string */
60 unmodified lines
1048 x += glyph->advance.x;1049 x += pt_or_px_as_pixels(render, &render->conf->letter_spacing);10501051 /* Cursor */960 if (cursor_location > 0 && cursor_location - 1 == i)961 render_cursor(render, x, y, buf->pix[0]);1052 if (cursor_location > 0 && cursor_location - 1 == i) {1053 update_cursor_rect(render, x, y);1054 if (have_preedit) {1055 x = render_preedit_at_cursor(1056 render, buf, x, y, max_x,1057 preedit, c32len(preedit), preedit_cursor, subpixel);1058 } else {1059 render_cursor(render, x, y, buf->pix[0]);1060 }1061 }10621063 prev = glyph->cp;1064 }1065 }
1211 unmodified lines
2277 return row;2278}22792280void2281render_get_cursor_rect(const struct render *render, int *x, int *y, int *w, int *h)2282{2283 *x = render->cursor_rect.x;2284 *y = render->cursor_rect.y;2285 *w = render->cursor_rect.w;2286 *h = render->cursor_rect.h;2287}22882289void2290render_flush_text_run_cache(struct render *render)2291{2292 fcft_text_run_destroy(render->prompt_text_run);2293 fcft_text_run_destroy(render->message_text_run);
5 unmodified lines
modified:render.h+5 added-1 removed
29 unmodified lines
30void render_message(struct render *render, struct buffer *buf);3132void render_prompt(33 struct render *render, struct buffer *buf,34 const struct prompt *prompt, const struct matches *matches);34 const struct prompt *prompt, const struct matches *matches,35 const char32_t *preedit, int32_t preedit_cursor);3637void render_get_cursor_rect(38 const struct render *render, int *x, int *y, int *w, int *h);3940void render_match_list(41 struct render *render, struct buffer *buf,42 const struct prompt *prompt, const struct matches *matches);43
5 unmodified lines
modified:wayland.c+342 added-1 removed
29 unmodified lines
30#include <cursor-shape-v1.h>31#include <fractional-scale-v1.h>32#include <primary-selection-unstable-v1.h>33#include <single-pixel-buffer-v1.h>34#include <text-input-unstable-v3.h>35#include <viewporter.h>36#include <wlr-layer-shell-unstable-v1.h>37#include <xdg-activation-v1.h>38#include <xdg-output-unstable-v1.h>
156 unmodified lines
195 bool have_primaries_srgb;196 } color_management;197198 struct wp_single_pixel_buffer_manager_v1 *single_pixel_manager;199 struct zwp_text_input_manager_v3 *text_input_manager;200201 /* Active preedit text (displayed inline in the prompt) */202 struct {203 char32_t *text; /* NULL when no preedit is active */204 int32_t cursor; /* glyph index for cursor (-1 = hidden) */205 } preedit;206207 tll(struct monitor) monitors;208 const struct monitor *monitor;209210 tll(struct seat) seats;
100 unmodified lines
311312 if (seat->wl_seat != NULL)313 wl_seat_release(seat->wl_seat);314315 if (seat->text_input != NULL)316 zwp_text_input_v3_destroy(seat->text_input);317 free(seat->ime.preedit_pending.text);318 free(seat->ime.commit_pending);319320 free(seat->clipboard.text);321 free(seat->primary.text);322 free(seat->name);323}
1189 unmodified lines
1513 .shape = wl_touch_shape,1514 .orientation = wl_touch_orientation,1515};15161517/*---------------------------------------------------------------------------1518 * text-input-unstable-v3 listener1519 *---------------------------------------------------------------------------*/15201521/*1522 * Convert a UTF-8 byte offset within a preedit string to the corresponding1523 * char32_t (glyph) index. Returns the glyph count if byte_offset is at or1524 * beyond the end of the string.1525 */1526static int32_t1527byte_offset_to_glyph_idx(const char *text, size_t byte_len, int32_t byte_offset)1528{1529 if (byte_offset < 0)1530 return -1;15311532 int32_t glyph_idx = 0;1533 size_t byte_idx = 0;15341535 while (byte_idx < byte_len) {1536 if ((int32_t)byte_idx == byte_offset)1537 return glyph_idx;15381539 int n = mblen(&text[byte_idx], byte_len - byte_idx);1540 if (n <= 0)1541 break;15421543 byte_idx += n;1544 glyph_idx++;1545 }15461547 /* byte_offset at or past end of string */1548 return glyph_idx;1549}15501551static void1552text_input_enter(void *data, struct zwp_text_input_v3 *text_input,1553 struct wl_surface *surface)1554{1555 struct seat *seat = data;1556 struct wayland *wayl = seat->wayl;15571558 LOG_DBG("text_input enter");15591560 /* Reset any stale pending state */1561 free(seat->ime.preedit_pending.text);1562 seat->ime.preedit_pending.text = NULL;1563 free(seat->ime.commit_pending);1564 seat->ime.commit_pending = NULL;15651566 zwp_text_input_v3_enable(text_input);1567 zwp_text_input_v3_set_content_type(1568 text_input,1569 ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE,1570 ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL);15711572 /* Send current cursor rect to position the IME popup */1573 int cx, cy, cw, ch;1574 render_get_cursor_rect(wayl->render, &cx, &cy, &cw, &ch);1575 const float scale = wayl->scale;1576 zwp_text_input_v3_set_cursor_rectangle(1577 text_input,1578 (int)(cx / scale), (int)(cy / scale),1579 (int)(cw / scale), (int)(ch / scale));15801581 zwp_text_input_v3_commit(text_input);1582 seat->ime.serial++;15831584 /* Record what we just sent */1585 seat->ime.cursor_rect.x = (int)(cx / scale);1586 seat->ime.cursor_rect.y = (int)(cy / scale);1587 seat->ime.cursor_rect.w = (int)(cw / scale);1588 seat->ime.cursor_rect.h = (int)(ch / scale);1589}15901591static void1592text_input_leave(void *data, struct zwp_text_input_v3 *text_input,1593 struct wl_surface *surface)1594{1595 struct seat *seat = data;1596 struct wayland *wayl = seat->wayl;15971598 LOG_DBG("text_input leave");15991600 free(seat->ime.preedit_pending.text);1601 seat->ime.preedit_pending.text = NULL;1602 free(seat->ime.commit_pending);1603 seat->ime.commit_pending = NULL;16041605 /* Clear any active preedit */1606 if (wayl->preedit.text != NULL) {1607 free(wayl->preedit.text);1608 wayl->preedit.text = NULL;1609 wayl->preedit.cursor = -1;1610 wayl_refresh(wayl);1611 }16121613 zwp_text_input_v3_disable(text_input);1614 zwp_text_input_v3_commit(text_input);1615 seat->ime.serial++;1616}16171618static void1619text_input_preedit_string(void *data, struct zwp_text_input_v3 *text_input,1620 const char *text, int32_t cursor_begin, int32_t cursor_end)1621{1622 struct seat *seat = data;16231624 LOG_DBG("preedit_string: text=%s begin=%d end=%d",1625 text ? text : "(null)", cursor_begin, cursor_end);16261627 free(seat->ime.preedit_pending.text);1628 seat->ime.preedit_pending.text = text ? xstrdup(text) : NULL;1629 seat->ime.preedit_pending.cursor_begin = cursor_begin;1630 seat->ime.preedit_pending.cursor_end = cursor_end;1631}16321633static void1634text_input_commit_string(void *data, struct zwp_text_input_v3 *text_input,1635 const char *text)1636{1637 struct seat *seat = data;16381639 LOG_DBG("commit_string: text=%s", text ? text : "(null)");16401641 free(seat->ime.commit_pending);1642 seat->ime.commit_pending = text ? xstrdup(text) : NULL;1643}16441645static void1646text_input_delete_surrounding_text(void *data,1647 struct zwp_text_input_v3 *text_input,1648 uint32_t before_length,1649 uint32_t after_length)1650{1651 /*1652 * We never call set_surrounding_text(), so the compositor should1653 * never request deletion of surrounding text. Log it anyway.1654 */1655 LOG_DBG("delete_surrounding_text: before=%u after=%u (ignored)",1656 before_length, after_length);1657}16581659static void1660text_input_done(void *data, struct zwp_text_input_v3 *text_input,1661 uint32_t serial)1662{1663 struct seat *seat = data;1664 struct wayland *wayl = seat->wayl;16651666 LOG_DBG("done: serial=%u (expected=%u)", serial, seat->ime.serial);16671668 /*1669 * Ignore stale events. The serial we track is the number of1670 * commit() calls we have made; the compositor echoes it back.1671 */1672 if (seat->ime.serial != serial) {1673 LOG_DBG("IME serial mismatch, discarding");1674 free(seat->ime.preedit_pending.text);1675 seat->ime.preedit_pending.text = NULL;1676 free(seat->ime.commit_pending);1677 seat->ime.commit_pending = NULL;1678 return;1679 }16801681 bool refresh = false;16821683 /*1684 * Apply protocol events in the required order:1685 * 1. Replace existing preedit with cursor.1686 * 2. Delete surrounding text (not implemented).1687 * 3. Insert commit string.1688 * 4. Calculate new surrounding text (not implemented).1689 * 5. Insert new preedit text at cursor.1690 * 6. Place cursor inside preedit.1691 */16921693 /* 1. Clear existing preedit */1694 if (wayl->preedit.text != NULL) {1695 free(wayl->preedit.text);1696 wayl->preedit.text = NULL;1697 wayl->preedit.cursor = -1;1698 refresh = true;1699 }17001701 /* 3. Insert commit string into the prompt */1702 bool did_commit = false;1703 if (seat->ime.commit_pending != NULL) {1704 const char *text = seat->ime.commit_pending;1705 prompt_insert_chars(wayl->prompt, text, strlen(text));1706 free(seat->ime.commit_pending);1707 seat->ime.commit_pending = NULL;1708 matches_update_incremental(wayl->matches);1709 matches_selected_set(wayl->matches, 0);1710 did_commit = true;1711 refresh = true;1712 }17131714 /* 5 & 6. Activate new preedit and compute cursor position */1715 if (seat->ime.preedit_pending.text != NULL &&1716 seat->ime.preedit_pending.text[0] != '\0')1717 {1718 const char *preedit_utf8 = seat->ime.preedit_pending.text;1719 const size_t byte_len = strlen(preedit_utf8);17201721 char32_t *preedit_c32 = ambstoc32(preedit_utf8);1722 if (preedit_c32 != NULL) {1723 wayl->preedit.text = preedit_c32;17241725 const int32_t cb = seat->ime.preedit_pending.cursor_begin;1726 const int32_t ce = seat->ime.preedit_pending.cursor_end;17271728 if (cb < 0 || ce < 0) {1729 /* Compositor requests hidden cursor within preedit */1730 wayl->preedit.cursor = -1;1731 } else {1732 /* Map the byte offset to a glyph (char32_t) index */1733 wayl->preedit.cursor =1734 byte_offset_to_glyph_idx(preedit_utf8, byte_len, cb);1735 }1736 }1737 free(seat->ime.preedit_pending.text);1738 seat->ime.preedit_pending.text = NULL;1739 refresh = true;1740 } else {1741 free(seat->ime.preedit_pending.text);1742 seat->ime.preedit_pending.text = NULL;1743 }17441745 if (refresh) {1746 wayl_refresh(wayl);1747 if (did_commit)1748 check_auto_select(seat, true);1749 }1750}17511752static const struct zwp_text_input_v3_listener text_input_listener = {1753 .enter = text_input_enter,1754 .leave = text_input_leave,1755 .preedit_string = text_input_preedit_string,1756 .commit_string = text_input_commit_string,1757 .delete_surrounding_text= text_input_delete_surrounding_text,1758 .done = text_input_done,1759};17601761static void1762seat_add_text_input(struct seat *seat)1763{1764 struct wayland *wayl = seat->wayl;17651766 if (wayl->text_input_manager == NULL)1767 return;1768 if (seat->text_input != NULL)1769 return;17701771 seat->text_input = zwp_text_input_manager_v3_get_text_input(1772 wayl->text_input_manager, seat->wl_seat);1773 if (seat->text_input == NULL) {1774 LOG_ERR("failed to create text_input object");1775 return;1776 }1777 zwp_text_input_v3_add_listener(1778 seat->text_input, &text_input_listener, seat);1779}17801781static void1782seat_handle_capabilities(void *data, struct wl_seat *wl_seat,1783 enum wl_seat_capability caps)1784{1785 struct seat *seat = data;
2 unmodified lines
1788 if (caps & WL_SEAT_CAPABILITY_KEYBOARD) {1789 if (seat->wl_keyboard == NULL) {1790 seat->wl_keyboard = wl_seat_get_keyboard(wl_seat);1791 wl_keyboard_add_listener(seat->wl_keyboard, &keyboard_listener, seat);1792 seat_add_text_input(seat);1793 }1794 } else {1795 if (seat->wl_keyboard != NULL) {1796 wl_keyboard_release(seat->wl_keyboard);1797 seat->wl_keyboard = NULL;1798 }1799 if (seat->text_input != NULL) {1800 zwp_text_input_v3_destroy(seat->text_input);1801 seat->text_input = NULL;1802 }1803 }18041805 if (caps & WL_SEAT_CAPABILITY_POINTER) {1806 if (seat->wl_pointer == NULL) {
831 unmodified lines
2638 wayl->registry, name,2639 &wp_single_pixel_buffer_manager_v1_interface, required);2640 }26412642 else if (strcmp(interface, zwp_text_input_manager_v3_interface.name) == 0) {2643 const uint32_t required = 1;2644 if (!verify_iface_version(interface, version, required))2645 return;26462647 wayl->text_input_manager = wl_registry_bind(2648 wayl->registry, name,2649 &zwp_text_input_manager_v3_interface, required);26502651 /* Late-bind: create text_input for seats already registered */2652 tll_foreach(wayl->seats, it)2653 seat_add_text_input(&it->item);2654 }26552656}26572658static void2659monitor_destroy(struct monitor *mon)
219 unmodified lines
2879 goto done;2880 }28812882 struct buffer *buf = shm_get_buffer(wayl->chain, wayl->width, wayl->height, true);2883 bool did_render_prompt = false;28842885 pixman_region32_t clip;2886 pixman_region32_init_rect(&clip, 0, 0, buf->width, buf->height);2887 pixman_image_set_clip_region32(buf->pix[0], &clip);
17 unmodified lines
2905 /* Window content */2906 matches_lock(wayl->matches);2907 render_message(wayl->render, buf);2908 if (!wayl->conf->hide_prompt) {2612 render_prompt(wayl->render, buf, wayl->prompt, wayl->matches);2909 render_prompt(wayl->render, buf, wayl->prompt, wayl->matches,2910 wayl->preedit.text, wayl->preedit.cursor);2911 did_render_prompt = true;2912 }2913 if (wayl->hide_when_prompt_empty) {2914 if (prompt_text(wayl->prompt)[0] != '\0') {2915 wayl->hide_when_prompt_empty = false;
14 unmodified lines
2930commit:2931 /* No pending frames - render immediately */2932 assert(!wayl->need_refresh);2933 commit_buffer(wayl, buf, false);29342935 /*2936 * After rendering, send an updated cursor rectangle to any active2937 * text_input so the IME popup tracks the cursor position.2938 * Only send when the cursor rect has actually changed to avoid2939 * generating spurious serial increments.2940 */2941 if (did_render_prompt) {2942 int cx, cy, cw, ch;2943 render_get_cursor_rect(wayl->render, &cx, &cy, &cw, &ch);2944 const float scale = wayl->scale;2945 const int sx = (int)(cx / scale);2946 const int sy = (int)(cy / scale);2947 const int sw = (int)(cw / scale);2948 const int sh = (int)(ch / scale);29492950 tll_foreach(wayl->seats, it) {2951 struct seat *seat = &it->item;2952 if (seat->text_input == NULL)2953 continue;2954 if (sx == seat->ime.cursor_rect.x &&2955 sy == seat->ime.cursor_rect.y &&2956 sw == seat->ime.cursor_rect.w &&2957 sh == seat->ime.cursor_rect.h)2958 continue;2959 zwp_text_input_v3_set_cursor_rectangle(2960 seat->text_input, sx, sy, sw, sh);2961 zwp_text_input_v3_commit(seat->text_input);2962 seat->ime.serial++;2963 seat->ime.cursor_rect.x = sx;2964 seat->ime.cursor_rect.y = sy;2965 seat->ime.cursor_rect.w = sw;2966 seat->ime.cursor_rect.h = sh;2967 }2968 }29692970done:29712972 time_finish(2973 start_frame, NULL, "%sframe rendered",
421 unmodified lines
3395 tll_foreach(wayl->monitors, it)3396 monitor_destroy(&it->item);3397 tll_free(wayl->monitors);33983399 free(wayl->preedit.text);3400 wayl->preedit.text = NULL;34013402 if (wayl->text_input_manager != NULL)3403 zwp_text_input_manager_v3_destroy(wayl->text_input_manager);34043405 if (wayl->single_pixel_manager != NULL)3406 wp_single_pixel_buffer_manager_v1_destroy(wayl->single_pixel_manager);3407 if (wayl->color_management_surface != NULL)3408 wp_color_management_surface_v1_destroy(wayl->color_management_surface);
135 unmodified lines
modified:wayland.h+16 added
1 unmodified line
23#include <stdbool.h>4#include <stdint.h>56struct zwp_text_input_v3; /* text-input-unstable-v3 */78#include <fcft/fcft.h>910#include "clipboard.h"11#include "config.h"
70 unmodified lines
8283 bool is_pasting;84 struct wl_clipboard clipboard;85 struct wl_primary primary;8687 struct zwp_text_input_v3 *text_input;88 struct {89 uint32_t serial; /* incremented on each commit() */90 struct {91 char *text; /* pending preedit UTF-8, NULL if none */92 int32_t cursor_begin; /* byte offset within preedit */93 int32_t cursor_end; /* byte offset within preedit */94 } preedit_pending;95 char *commit_pending; /* pending commit UTF-8, NULL if none */96 struct {97 int x, y, w, h; /* last sent cursor rect (surface coords) */98 } cursor_rect;99 } ime;100};101102103typedef void (*font_reloaded_t)(
25 unmodified lines