Commit graph

18 commits

Author SHA1 Message Date
Daniel Eklöf
2227e36c66
ime: don’t call text-input functions when it isn’t available
Closes #259
2020-12-26 12:09:48 +01:00
Daniel Eklöf
a6ed9a9773
ime: don’t underline characters inside the cursor-box 2020-12-07 20:44:15 +01:00
Daniel Eklöf
fd42a0bc23
ime: call render_refresh_search() instead of render_refresh()
When scrollback search is active
2020-12-07 20:44:14 +01:00
Daniel Eklöf
194fbff883
ime: store wchar version of pre-edit string in terminal struct 2020-12-07 20:44:14 +01:00
Daniel Eklöf
d87160e5f6
ime: commit text using search_add_chars() while in scrollback search mode 2020-12-07 20:44:12 +01:00
Daniel Eklöf
7eea6f94ed
ime: don’t commit to the slave while scrollback searching 2020-12-07 20:44:12 +01:00
Daniel Eklöf
b59d695b2b
ime: add functions to enable/disable IME, simplify code that enables IME
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.
2020-12-07 20:44:11 +01:00
Daniel Eklöf
5c17b7f8e7
ime: expand cursor cell-end across multi-cell characters
This fixes an issue where the cursor ended in the middle of e.g double
width characters.
2020-12-07 20:44:11 +01:00
Daniel Eklöf
001c82fa54
ime: don’t adjust cursor’s cell-end if it’s equal to the cell-begin 2020-12-07 20:44:11 +01:00
Daniel Eklöf
552b9884b9
ime: set cursor end correctly when it ends *after* the pre-edit string 2020-12-07 20:44:11 +01:00
Daniel Eklöf
cc76f91c43
ime: use correct index when calculating number of *cells* to advance 2020-12-07 20:44:11 +01:00
Daniel Eklöf
98bd798dae
ime: calculate wchar widths once 2020-12-07 20:44:10 +01:00
Daniel Eklöf
05083110c3
ime: make IME compile-time optional 2020-12-07 20:44:10 +01:00
Daniel Eklöf
8c3d48c5cd
ime: render pre-edit text
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.
2020-12-07 20:44:10 +01:00
Daniel Eklöf
5745c610ac
ime: wip: commit all changes in ‘done()’ 2020-12-07 20:44:10 +01:00
Daniel Eklöf
b85e2f40bb
ime: feed committed string to client application 2020-12-07 20:44:10 +01:00
Daniel Eklöf
e97024116e
ime: disable text-input on surface leave 2020-12-07 20:44:10 +01:00
Daniel Eklöf
148bb1ff13
ime: wip: add text-input object to seat 2020-12-07 20:44:09 +01:00