godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine

Home Page:https://godotengine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game window loses focus due to scene group update

KoBeWi opened this issue · comments

Tested versions

4.3 beta3

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

Regression from #89739, though I didn't notice it until recently. Might be a combination of various factors.

When you launch the project, all scenes are saved, which triggers update of scene groups, which causes editor progress to appear due to groups. The editor progress makes the window focused, stealing focus from the launched project.

Steps to reproduce

  1. Make sure run/auto_save/save_before_running is enabled
  2. Open multiple scenes
  3. Run the project
  4. See that the running window is not focused

Minimal reproduction project (MRP)

N/A

Regression from #89739

IIRC there were optimizations to how long it takes to scan scenes for groups. Maybe that progress bar isn't needed anymore?

It's still needed, but we could raise the threshold (#90784) to e.g. 20.

I wonder why the project is not focused as it is started AFTER all the saving was done, isn't it?

If the project is big enough, there is a delay between saving and doing a filesystem scan (or more like, it takes a while to finish it fully). Scene group update happens at the end of scan, so if gets delayed, it can happen after starting the project. I was not able to reproduce it in a simple project.