godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.58k stars 19.3k forks source link

Godot is brought to front while checking for files to import, disrupting workflow with other programs #74099

Open AhNesh opened 1 year ago

AhNesh commented 1 year ago

Godot version

4.0.rc6.mono

System information

Windows 10

Issue description

Godot window grabs focus and is brought to front when checking for files to import, which it usually does when I click back into Godot, but sometimes it chooses to do this when I click away to a different program. That program then gets hidden behind Godot and I have to click on it again to actually show it. Sometimes I get stuck fighting with Godot because it keeps taking focus while I am trying to work in another program.

Is it necessary for Godot to grab focus when looking for new files to import? If it didn't do that this issue would go away. It didn't do that in 3.5.

Steps to reproduce

Some of the behavior I have seen I am not able to reproduce consistently, but I can reproduce the 'click on it again' problem:

Stack Godot and another program on top of each other, both maximized. With the other program in focus and on top, click on Godot to focus it, then click on the other program again. The other program pops up briefly, then Godot takes focus again. Sometimes this repeats when clicking on the program again.

Minimal reproduction project

N/A

AhNesh commented 1 year ago

And sometimes it happens when running a scene, the game window gets hidden behind the editor because the editor grabbed focus

AhNesh commented 1 year ago

I made an MPR for a different issue, and that project does not have this behavior. It seems there is something in my main project that causes Godot to check for files to import every time Godot gets focus. Any idea what that could be?

AhNesh commented 1 year ago

It is an SVG file that causes this:

texture_01

After removing it and re-adding it, these errors are printed to the output.

ImageLoaderSVG: Couldn't set target on ThorVG canvas.
core/io/image_loader.cpp:101 - Error loading image: res://Textures/texture_01.svg
Error importing 'res://Textures/texture_01.svg'.
akien-mga commented 1 year ago

Related to https://github.com/godotengine/godot/issues/62271