From 905a09cce76a9fd3a5abdf5b0578e8e350dc5187 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Wed, 6 Dec 2023 02:39:36 +0100 Subject: [PATCH] Add autotype delay to account for focus shift --- autofill/autotype/libportalautotype.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/autofill/autotype/libportalautotype.go b/autofill/autotype/libportalautotype.go index 23e85f8..9edc1e8 100644 --- a/autofill/autotype/libportalautotype.go +++ b/autofill/autotype/libportalautotype.go @@ -48,6 +48,7 @@ func TypeString(textToType string, layout string) { state = 2 } else if state == 2 { state = 3 + time.Sleep(200 * time.Millisecond) for _, char := range textToType { if char == '\t' { obj.Call("org.freedesktop.portal.RemoteDesktop.NotifyKeyboardKeycode", 0, sessionHandle, map[string]dbus.Variant{}, 15, uint32(1)) @@ -63,9 +64,6 @@ func TypeString(textToType string, layout string) { } bus.Close() return - } else { - fmt.Println("state", state) - fmt.Println("Message:", message) } } }