Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message whenever unfocusing editor window while working on a saved scene. #89570

Closed
goblinrockcandy opened this issue Mar 16, 2024 · 10 comments

Comments

@goblinrockcandy
Copy link

goblinrockcandy commented Mar 16, 2024

Tested versions

  • Reproducible in (with minor variations across versions):
  • v4.0.stable.official [92bee43]
  • v4.2.1.stable.official [b09f793]
  • v4.2.2.rc2.official [c61a686]

System information

Godot v4.2.1.stable - Windows 10.0.22631 - GLES3 (Compatibility) - Intel(R) Iris(R) Xe Graphics (Intel Corporation; 31.0.101.1999) - 12th Gen Intel(R) Core(TM) i7-1260P (16 Threads)

Issue description

This error is written to Output for each time I click out of the editor on any project when working on a saved scene:

Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
scene/main/window.cpp:1658 - Condition "!is_inside_tree()" is true.

I don't think I've ever seen that path or its number change (scene/main/window.cpp:1658).

This happens in new projects too. To my knowledge, it doesn't do anything to really cause any real problems. I do have some other issues, but I think those are separate matters (mainly, nested custom resources breaking and returning null on use but still showing up in the stack trace and inspector).


*I would also like to mention that this is my first time using GitHub to contribute anything. Feel free to let me know if I'm doing anything wrong

Steps to reproduce

The error occurs whenever the editor loses focus (ex. when I click outside of the window). This happens in both my main project that I've been working on, but also a brand new project.

However, it only happens when inside a saved scene (I tested a plain Node2D scene and a Node3D scene). If I am in an unsaved 'new tab' labelled [empty] or another unsaved new scene, then the editor does not give the error.

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

AThousandShips commented Mar 16, 2024

Can you test this in 4.2.2.rc2? This sounds familiar and might be fixed

However this doesn't seem like something that's universal, or we'd see a lot of reports, so it's very likely specific to your project so we'd need to have an example of it happening, it doesn't happen in a new project

@goblinrockcandy
Copy link
Author

I ran some tests and received some results.

Summary:
Can be reproduced, but so far, only for me. Error is usually mundane, except after experiencing its freeze on 4.2.2.rc2, each new scene, when saved for the first time, will freeze the editor completely (with the exception of outputting new error messages for each unfocus). The exception to this is 4.0.stable, which will only freeze on the first scene saved of any freshly-created new projects. When reloading the project, new scenes can be saved without the freeze.
The typical behaviour is an error message outputted whenever clicking off the Godot Editor. The message itself varies from version (often the path). The worst case is the freezing, which can be worked around by closing Godot in the task manager, and reloading the project for each new scene saved.
Because the error only happens for me, but still carries across versions, I think it may be something in my Godot Editor Settings, configurations, or maybe my User and Roaming file that messes with this. I'll play with my settings and update on if anything seems to cause or fix it.


Here are the unabridged details for each test:

Note: Both Tests 1 and 2 were not editor-breaking

Test 1

v4.0.stable - New Project

Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
  scene/main/window.cpp:1456 - Condition "!is_inside_tree()" is true.
  • Path: scene/main/window.cpp:1456

Test 2

v4.2.1.stable - New Project

  Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
  scene/main/window.cpp:1658 - Condition "!is_inside_tree()" is true.
  • Path: scene/main/window.cpp:1658

Test 3:

4.2.2.rc2 - New Project (after saving scene for first time)
Editor became unresponsive for the first time. After this test, the other breaking-cases started happening.
First at the beginning, it outputted this error (once):

Signal 'focus_entered' is already connected to given callable 'AcceptDialog::_parent_focused' in that object.
Can't make active a Viewport that is already active.

Along with the following error. After that, it proceeded to output this error on each unfocus:

platform/windows/display_server_windows.cpp:1313 - Condition "!windows.has(p_window)" is true. Returning: -1

Could be reproduced by following the steps to reproduce:
Steps to Reproduce:

  • Create new project
  • Create new Scene
  • Save scene
  • Error occurs

Notes:

  • Path: platform/windows/display_server_windows.cpp:1313
  • Window is completely unresponsive to everything except unfocusing the editor window or (which results in outputting errors). I couldn’t select or copy the error message either, so I transcribed it from the attached screenshot
  • Editor wouldn’t exit by clicking the x-button, I had to end the process from the process manager

image

Test 4

4.2.2.rc2 - Previous Project (loading the scene saved from Test 3)
Responsive.
On unfocus:

  Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
  scene/main/window.cpp:1658 - Condition "!is_inside_tree()" is true.
  • Path: scene/main/window.cpp:1658

Test 5

4.2.1.stable - New Project
Unresponsive. Could be reproduced.
Displays these errors first:

Signal 'focus_entered' is already connected to given callable 'AcceptDialog::_parent_focused' in that object.
Can't make active a Viewport that is already active.

On unfocus:

platform/windows/display_server_windows.cpp:1310 - Condition "!windows.has(p_window)" is true. Returning: -1
  • Path: platform/windows/display_server_windows.cpp:1310

Test 6

4.2.1.stable - Previous Project (loading scene saved from Test 5)
On unfocus:

  Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead.
  scene/main/window.cpp:1658 - Condition "!is_inside_tree()" is true.
  • Path: scene/main/window.cpp:1658

Test 7

4.0.stable - New Project
Unresponsive. Could be reproduced. Outputted 16 errors along for the first few times I unfocused. The errors seemed to be composed of a combination of repetitions from the following error messages (see screenshot below):

  • Signal 'focus_entered' is already connected to given callable 'AcceptDialog::_parent_focused' in that object.
  • Can't make active a Viewport that is already active.
  • platform/windows/gl_manager_windows.cpp:279 - Could not switch OpenGL context to other window: Error 6: The handle is invalid
  • platform/windows/display_server_windows.cpp:966 - Condition "!windows.has(p_window)" is true. Returning: -1
  • (a literal blank error message, with the red dot but no text)

Paths:

  • platform/windows/gl_manager_windows.cpp:279
  • platform/windows/display_server_windows.cpp:966

image

On unfocus (alongside a blank error):

platform/windows/gl_manager_windows.cpp:279 - Could not switch OpenGL context to other window: Error 6: The handle is invalid

Uniquely to 4.0.stable, it seems that only the first scene save on brand new projects causes this error. Upon opening up the new project after closing it and saving a new scene, we get the usual results from Test 1 rather than the editor-breaking ones. However, I did manage to reproduce the results from Test 7 on a brand new project on the same version.

@AThousandShips
Copy link
Member

Please delete your editor settings and similar and try, this isn't a bug in the editor, and unless this is an issue that can be solved by a change in the engine, and not something that's broken in your drivers, or configuration, there's nothing we can do really, so please see if clearing your data helps

@goblinrockcandy
Copy link
Author

Update: I believe this is caused by Save on Focus Loss being on in Editor Settings (Interface > Editor > Save on Focus Loss), because turning it off has made the error messages stop appearing.

@David-CHST
Copy link

Update: I believe this is caused by Save on Focus Loss being on in Editor Settings (Interface > Editor > Save on Focus Loss), because turning it off has made the error messages stop appearing.

Can confirm, looked this thread up because I had the exact same problem. Disabling Save on Focus Loss solved the issue.

@AlexanderFarkas
Copy link
Contributor

AlexanderFarkas commented May 4, 2024

Screenshot 2024-05-04 at 12 29 55

Godot v4.3.dev (5d08c26) - macOS 14.4.1 - Vulkan (Mobile) - integrated Apple M1 Pro - Apple M1 Pro (10 Threads)

@AlexanderFarkas
Copy link
Contributor

@AThousandShips Save on Focus is handled via Node::propagate_notification, which increases data.blocked before propagation. Since Save Dialog is displayed on the root Window (due to absence of any focused windows), it always fails.

@AThousandShips
Copy link
Member

AThousandShips commented May 4, 2024

This isn't my area of expertise so no use pinging me with details, but hopefully someone can use that information

@AlexanderFarkas
Copy link
Contributor

Duplicate of #73765

@akien-mga
Copy link
Member

Thanks, consolidating in #73765.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants