~eliasnaur/gio-patches

gio: io/router: allow focus without open soft-keyboard v1 PROPOSED

~inkeliz
~inkeliz: 1
 io/router: allow focus without open soft-keyboard

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/15379/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gio] io/router: allow focus without open soft-keyboard Export this patch

~inkeliz
From: Inkeliz <inkeliz@inkeliz.com>

That really small patch allow the `InputOp` be combined with `HideInputOp` in the same frame. The priority was changed to `HideInputOp`.

Since the priority is to the `HideInputOp`, we can:

- Remove the focus without open the software-keyboard (mitigates gio#180).
- Listen to key inputs without open software-keyboard.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
---
 io/router/key.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/io/router/key.go b/io/router/key.go
index a64544b..9408ba5 100644
--- a/io/router/key.go
+++ b/io/router/key.go
@@ -74,10 +74,10 @@ func (q *keyQueue) Frame(root *op.Ops, events *handlerEvents) {
		}
	}
	switch {
	case pri == priNewFocus:
		q.state = TextInputOpen
	case hide:
		q.state = TextInputClose
	case pri == priNewFocus:
		q.state = TextInputOpen
	default:
		q.state = TextInputKeep
	}
-- 
2.26.2