{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/6048","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/6048/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/6048/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/6048/events","html_url":"https://github.com/godotengine/godot/issues/6048","id":169592643,"number":6048,"title":"grab_focus stopped working without call_deferred","user":{"login":"ArcFutahito","id":10696955,"avatar_url":"https://avatars.githubusercontent.com/u/10696955?v=3","gravatar_id":"","url":"https://api.github.com/users/ArcFutahito","html_url":"https://github.com/ArcFutahito","followers_url":"https://api.github.com/users/ArcFutahito/followers","following_url":"https://api.github.com/users/ArcFutahito/following{/other_user}","gists_url":"https://api.github.com/users/ArcFutahito/gists{/gist_id}","starred_url":"https://api.github.com/users/ArcFutahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArcFutahito/subscriptions","organizations_url":"https://api.github.com/users/ArcFutahito/orgs","repos_url":"https://api.github.com/users/ArcFutahito/repos","events_url":"https://api.github.com/users/ArcFutahito/events{/privacy}","received_events_url":"https://api.github.com/users/ArcFutahito/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-05T12:04:35Z","updated_at":"2016-08-05T12:07:50Z","closed_at":null,"body":"godot alpha 2.2 (5 aug build) linux x86\r\n\r\nWhen I switched to new build (from 2.1 alpha), grab_focus stopped working everywhere. Script snippet: \r\n\r\nConditions are satisfied (checked with print). Grab_focus refuses to work without doing call_deferred. With call_deferred grab_focus works. \r\n`func grab():`\r\n` get_node(\"BattleMenu/VBoxContainer/Attack\").grab_focus()`\r\n`if (event.is_action_released(\"ui_accept\") && !event.is_echo() && state == 'Idle'):`\r\n` get_node(\"Main Menu\").set_disabled(true)`\r\n` battle.play(\"popup\")`\r\n` if get_node(\"BattleMenu/VBoxContainer/Attack\").get(\"disabled\") == false:`\r\n`  print(\"blerb\")`\r\n`  call_deferred('grab')`\r\n` elif get_node(\"BattleMenu/VBoxContainer/Magic\").get(\"disabled\") == false:`\r\n`  get_node(\"BattleMenu/VBoxContainer/Magic\").grab_focus()`\r\n` elif get_node(\"BattleMenu/VBoxContainer/Special\").get(\"disabled\") == false:`\r\n`  get_node(\"BattleMenu/VBoxContainer/Special\").grab_focus()`\r\n` elif get_node(\"BattleMenu/VBoxContainer/Items\").get(\"disabled\") == false:`\r\n`  get_node(\"BattleMenu/VBoxContainer/Items\").grab_focus()`\r\n` get_tree().set_pause(true)`\r\n` state \t\t\t= 'BattleMenu'`"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/237834197","html_url":"https://github.com/godotengine/godot/issues/6048#issuecomment-237834197","issue_url":"https://api.github.com/repos/godotengine/godot/issues/6048","id":237834197,"user":{"login":"reduz","id":6265307,"avatar_url":"https://avatars.githubusercontent.com/u/6265307?v=3","gravatar_id":"","url":"https://api.github.com/users/reduz","html_url":"https://github.com/reduz","followers_url":"https://api.github.com/users/reduz/followers","following_url":"https://api.github.com/users/reduz/following{/other_user}","gists_url":"https://api.github.com/users/reduz/gists{/gist_id}","starred_url":"https://api.github.com/users/reduz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reduz/subscriptions","organizations_url":"https://api.github.com/users/reduz/orgs","repos_url":"https://api.github.com/users/reduz/repos","events_url":"https://api.github.com/users/reduz/events{/privacy}","received_events_url":"https://api.github.com/users/reduz/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T12:07:50Z","updated_at":"2016-08-05T12:07:50Z","body":"I don't think I understand this much, but there can be only one control\nwith focus at the same time..\n\nalso get(\"disabled\") and .disabled is the same\n\n\nOn Fri, Aug 5, 2016 at 9:04 AM, ArcFutahito <notifications@github.com>\nwrote:\n\n> godot alpha 2.2 (5 aug build) linux x86\n>\n> When I switched to new build (from 2.1 alpha), grab_focus stopped working\n> everywhere. Script snippet:\n>\n> Conditions are satisfied (checked with print). Grab_focus refuses to work\n> without doing call_deferred. With call_deferred grab_focus works.\n> `\n> func grab():\n> get_node(\"BattleMenu/VBoxContainer/Attack\").grab_focus()\n>\n> if (event.is_action_released(\"ui_accept\") && !event.is_echo() && state ==\n> 'Idle'):\n> get_node(\"Main Menu\").set_disabled(true)\n> battle.play(\"popup\")\n> if get_node(\"BattleMenu/VBoxContainer/Attack\").get(\"disabled\") == false:\n> print(\"blerb\")\n> call_deferred('grab')\n> elif get_node(\"BattleMenu/VBoxContainer/Magic\").get(\"disabled\") == false:\n> get_node(\"BattleMenu/VBoxContainer/Magic\").grab_focus()\n> elif get_node(\"BattleMenu/VBoxContainer/Special\").get(\"disabled\") == false:\n> get_node(\"BattleMenu/VBoxContainer/Special\").grab_focus()\n> elif get_node(\"BattleMenu/VBoxContainer/Items\").get(\"disabled\") == false:\n> get_node(\"BattleMenu/VBoxContainer/Items\").grab_focus()\n> get_tree().set_pause(true)\n> state = 'BattleMenu'`\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/godotengine/godot/issues/6048>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AF-Z26QNmx5mFzTaM-a8vZK8TiQXp6CIks5qcybggaJpZM4Jdnm9>\n> .\n>\n"}}
{"actor":{"display_login":"reduz"}}