You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Fix "grab_focus: Condition "!is_inside_tree()" is true" when AcceptDialog was visible from the editor.
This commit is contained in:
@@ -60,9 +60,16 @@ void AcceptDialog::_update_theme_item_cache() {
|
|||||||
|
|
||||||
void AcceptDialog::_notification(int p_what) {
|
void AcceptDialog::_notification(int p_what) {
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
case NOTIFICATION_POST_ENTER_TREE: {
|
||||||
if (is_visible()) {
|
if (is_visible()) {
|
||||||
get_ok_button()->grab_focus();
|
get_ok_button()->grab_focus();
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||||
|
if (is_visible()) {
|
||||||
|
if (get_ok_button()->is_inside_tree()) {
|
||||||
|
get_ok_button()->grab_focus();
|
||||||
|
}
|
||||||
_update_child_rects();
|
_update_child_rects();
|
||||||
parent_visible = get_parent_visible_window();
|
parent_visible = get_parent_visible_window();
|
||||||
if (parent_visible) {
|
if (parent_visible) {
|
||||||
|
|||||||
Reference in New Issue
Block a user