aboutsummaryrefslogtreecommitdiff
path: root/ime.c (follow)
Commit message (Collapse)AuthorAgeLines
* term: rename CELL_MULT_COL_SPACER -> CELL_SPACER, and change its definitionDaniel Eklöf2021-05-14-2/+2
| | | | | | | | | | | | | | | | | | | | | Instead of using CELL_SPACER for *all* cells that previously used CELL_MULT_COL_SPACER, include the remaining number of spacers following, and including, itself. This is encoded by adding to the CELL_SPACER value. So, a double width character will now store the character itself in the first cell (just like before), and CELL_SPACER+1 in the second cell. A three-cell character would store the character itself, then CELL_SPACER+2, and finally CELL_SPACER+1. In other words, the last spacer is always CELL_SPACER+1. CELL_SPACER+0 is used when padding at the right margin. I.e. when writing e.g. a double width character in the last column, we insert a CELL_SPACER+0 pad character, and then write the double width character in the first column on the next row.
* config: add ‘beam-thickness’ optionDaniel Eklöf2021-04-30-1/+1
| | | | | | | | | | | * Rename cursor.style value ‘bar’ to ‘beam’. ‘bar’ remains recognized, but should eventually be deprecated and then removed. * Add ‘cursor.beam-thickness’ option, a pt-or-px value specifying the thickness of the beam cursor. Defaults to 1.5pt. * Rename (and export) pt_or_px_as_pixels() to term_pt_or_px_as_pixels() * Change term_pt_or_px_as_pixels() to round point values instead of truncating them.
* ime: set ‘have_warned = true’ to avoid warning over and over againDaniel Eklöf2021-03-25-0/+1
|
* ime: log warning on text-input::done() received without keyboard focusDaniel Eklöf2021-03-25-0/+9
|
* ime: don’t enable IME if we don’t have keyboard focusDaniel Eklöf2021-03-25-8/+4
| | | | Closes #411
* ime: don’t pass ‘term’ to ime_update_cursor_rect()Daniel Eklöf2021-03-25-6/+9
| | | | | | | | | In all instances where we call ime_update_cursor_rect(), the ‘term’ argument is the same as seat->kbd_focus. So, let ime_update_cursor_rect() use that directly instead. Also make ime_send_cursor_rect() static (i.e. local to ime.c).
* ime: codespell: actaually -> actuallyDaniel Eklöf2021-03-25-1/+1
|
* ime: move preedit state from terminal struct to the seat structDaniel Eklöf2021-03-25-63/+85
| | | | | | | | | | | | | | | | | This ensures different seat’s don’t step on each others IME pre-edit state. It also removes most dependencies on having a valid term pointer for many IME operations. We’re still not all the way, since we support disabling IME with a private mode, which is per terminal, not seat. Thus, we still require the seat to have keyboard focus on one of our windows. Closes #324. But note that *rendering* of multiple seat’s IME pre-edit strings is still broken.
* ime: don’t commit IME changes when we don’t have IME focusDaniel Eklöf2021-03-02-0/+11
| | | | | | | | | Fixes log spamming in Sway: 00:54:07.780 [DEBUG] [wlr] [types/wlr_text_input_v3.c:181] Text input commit received without focus 00:54:07.780 [INFO] [sway/input/text_input.c:127] Inactive text input tried to commit an update Closes #384
* ime: enter(): remove assertion on surface kind being TERM_SURF_GRIDDaniel Eklöf2021-02-07-5/+1
| | | | | | The main surface is the *only* IME capable surface we have. If the compositor is sending an ime::enter event for another surface, it is a compositor bug, not a foot bug.
* ime: Reset terminal's IME state on text_input.leaveTadeo Kondrak2021-01-30-0/+5
| | | | | | | | To reproduce issue: - Launch an IME from inside foot - Type in some preedit text - Use Ctrl-C to close the IME - IME text stays in terminal until focus is changed
* Send text_input_rectangle requests for text-inputTadeo Kondrak2021-01-29-0/+77
|
* ime: fix rendering of pre-edit cursor when positioned after the pre-edit stringDaniel Eklöf2021-01-26-8/+11
| | | | | | | | | | | | We failed to convert the byte-indices to cell indices, resulting in a box cursor covering the entire pre-edit string. Note that in addition to fixing the translation from byte index to cell index, the rendered had to be updated to dirty one extra cell from the original grid. Without this, we left trailing cursors behind us when the user deleted text from the pre-edit string.
* debug: rename assert() to xassert(), to avoid clashing with <assert.h>Craig Barnes2021-01-16-9/+9
|
* ime: don’t call text-input functions when it isn’t availableDaniel Eklöf2020-12-26-0/+6
| | | | Closes #259
* ime: don’t underline characters inside the cursor-boxDaniel Eklöf2020-12-07-117/+123
|
* ime: call render_refresh_search() instead of render_refresh()Daniel Eklöf2020-12-07-2/+8
| | | | When scrollback search is active
* ime: store wchar version of pre-edit string in terminal structDaniel Eklöf2020-12-07-4/+5
|
* ime: commit text using search_add_chars() while in scrollback search modeDaniel Eklöf2020-12-07-7/+8
|
* ime: don’t commit to the slave while scrollback searchingDaniel Eklöf2020-12-07-5/+9
|
* ime: add functions to enable/disable IME, simplify code that enables IMEDaniel Eklöf2020-12-07-40/+42
| | | | | | | | | | | | | | | | | We may want to be able to enable/disable IME run-time, even though we have received an ‘enter’ IME event. This enables us to do that. Also add functions to enable/disable IME on a per-terminal instance basis. A terminal may have multiple seats focusing it, and enabling/disabling IME in a terminal instance enables/disables IME on all those seats. Finally, the code to enable IME is simplified; the *only* surface that can ever receive ‘enter’ IME events is the main grid. All other surfaces are sub-surfaces, without their own keyboard focus.
* ime: expand cursor cell-end across multi-cell charactersDaniel Eklöf2020-12-07-0/+7
| | | | | This fixes an issue where the cursor ended in the middle of e.g double width characters.
* ime: don’t adjust cursor’s cell-end if it’s equal to the cell-beginDaniel Eklöf2020-12-07-6/+12
|
* ime: set cursor end correctly when it ends *after* the pre-edit stringDaniel Eklöf2020-12-07-0/+3
|
* ime: use correct index when calculating number of *cells* to advanceDaniel Eklöf2020-12-07-1/+1
|
* ime: calculate wchar widths onceDaniel Eklöf2020-12-07-3/+8
|
* ime: make IME compile-time optionalDaniel Eklöf2020-12-07-17/+46
|
* ime: render pre-edit textDaniel Eklöf2020-12-07-22/+187
| | | | | | | | | | | | | | This is done by allocating cells for the pre-edit text when receiving the text-input::done() call, and populating them by converting the utf-8 formatted pre-edit text to wchars. We also convert the pre-edit cursor position to cell positions (it can cover multiple cells). When rendering, we simply render the pre-edit cells on-top off the regular grid. While doing so, we also mark the underlying, “real”, cells as dirty, to ensure they are re-rendered when the pre-edit text is modified or removed.
* ime: wip: commit all changes in ‘done()’Daniel Eklöf2020-12-07-2/+40
|
* ime: feed committed string to client applicationDaniel Eklöf2020-12-07-0/+4
|
* ime: disable text-input on surface leaveDaniel Eklöf2020-12-07-2/+4
|
* ime: wip: add text-input object to seatDaniel Eklöf2020-12-07-0/+97