Ui, Edit: a keyboard sent away stays away until the field is tapped
On Plasma Mobile the on-screen keyboard came straight back after its own hide key. The key makes the compositor give the keyboard's room back: the window grows, the message field moves down with the window's lower edge, and UpdateTextInput told the compositor the caret's new place, as it does after every frame in which the caret moved. No focus had changed and no enable went out again (the library sends one per focus); 120 ms after that state was committed the keyboard was back, nothing else having been sent. A caret that only followed the window's growth is no longer told at once: its box as it was, lower by what the window gained (CaretFollowedGrowth, in Edit with its tests). It is told with the next thing that is — a key that moves the caret, the field's tap — and a window that shrinks back makes the old place true again. The compositor keeps the old place meanwhile, which lies inside the taller window. With that telling gone nothing would bring the keyboard back, so a tap on a field that kept the focus while the window grew asks for it (AskKeyboard): the text input goes off, the composing word going into the field as at any reset, and the next frame turns it on again, which is the request a compositor shows its keyboard for. A tap with the keyboard up places the cursor as before. The number field of the new-conversation screen takes the same tap. Tested: tests/Edit (a caret lower by the window's growth, and one within a pixel of that; and what is still told: a caret that stayed, one that moved along its line or by another amount, a window as tall as it was or lower, a box of another size). On a Fairphone 6 (Plasma Mobile 6.8.2, plasma-keyboard 6.8.2), by the protocol's trace (WAYLAND_DEBUG): before, the hide key's resize is followed by set_cursor_rectangle and commit, and by the keyboard's resize 120 ms after them; with this, nothing is sent after the hide key's resize and the keyboard stays away, and a tap on the field sends disable, then enable with the caret's place, the keyboard is back 85 ms later, and typing goes on. The number field's tap was not tried on the phone, and no bench on the workstation has an on-screen keyboard.
This commit is contained in:
parent
b8907867df
commit
ca5cd72d65
3 changed files with 71 additions and 2 deletions
|
|
@ -143,6 +143,19 @@ int main() {
|
|||
Check(ComposeFirstLine(19, 5) == 15, "the same far down a long text");
|
||||
Check(ComposeFirstLine(0, 1) == 0 && ComposeFirstLine(7, 1) == 7, "a one-line field shows the caret's line");
|
||||
|
||||
// --- a caret that only followed the window's growth: the keyboard went -
|
||||
{
|
||||
const CaretReport told{ 76, 1002, 4, 24, 1068 }; // the message field's caret above the keyboard
|
||||
Check(CaretFollowedGrowth(told, { 76, 1526, 4, 24, 1592 }), "the window grew and the caret went down by as much: it only followed the growth");
|
||||
Check(CaretFollowedGrowth(told, { 76.5f, 1526.8f, 4, 24, 1592 }), "within a pixel of it, as a rounded layout gives");
|
||||
Check(!CaretFollowedGrowth(told, { 76, 1002, 4, 24, 1592 }), "a caret that stayed where it was in a window that grew (a field at the top) did not move at all: nothing held");
|
||||
Check(!CaretFollowedGrowth(told, { 94, 1526, 4, 24, 1592 }), "a caret that moved along its line as well is told");
|
||||
Check(!CaretFollowedGrowth(told, { 76, 1502, 4, 24, 1592 }), "one that moved by another amount (a line more or less) is told");
|
||||
Check(!CaretFollowedGrowth(told, { 76, 1002, 4, 24, 1068 }) && !CaretFollowedGrowth(told, { 76, 1026, 4, 24, 1068 }), "the window as tall as it was: every move is told");
|
||||
Check(!CaretFollowedGrowth({ 76, 1526, 4, 24, 1592 }, { 76, 1002, 4, 24, 1068 }), "the window shrank (the keyboard came up): the caret's new place is told");
|
||||
Check(!CaretFollowedGrowth(told, { 76, 1526, 4, 30, 1592 }), "a box of another size is told");
|
||||
}
|
||||
|
||||
// The drafts of the conversations left: kept by key, taken up at the
|
||||
// next opening.
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue