From ca73c2f255862e4a5860545a7615c78cd2043171 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 25 Sep 2019 09:15:49 -0500 Subject: [PATCH] Another attempted fix for cases where focus is unset and nothing can be done. When we unfocus, wait a second. If we don't have focus after the timer elapses, warp the mouse to the global coordinates. This seems to restore some semblance of focus whenever it is unset, while not breaking the case where a focus is set and the mouse suddenly jumps, thus changing the focus again. --- Accessible.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Accessible.gd b/Accessible.gd index 8e380e4..9cb9a4c 100644 --- a/Accessible.gd +++ b/Accessible.gd @@ -378,6 +378,9 @@ func focus(): func unfocus(): print("Unfocused") position_in_children = 0 + yield(node.get_tree().create_timer(1), "timeout") + if not node.get_focus_owner(): + node.get_tree().root.warp_mouse(node.rect_global_position) func click_focus(): if node.has_focus():