godotengine / godot

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

Second "Files have been modified on disk" dialog not focused #97451

Open michaelgundlach opened 1 month ago

michaelgundlach commented 1 month ago

Tested versions

4.x

System information

Godot v4.3.stable - macOS 13.0.1 - Vulkan (Mobile) - integrated Apple M1 - Apple M1 (8 Threads)

Issue description

When reloading a project that has changed on disk, two "Files have been modified on disk" dialogs are generated rather than one; and the second is not focused, requiring an extra click to clear it.

You can repro this just by touching files in a terminal, but in practice I run into this every time I change git branches via the terminal.

Steps to reproduce

  1. Open a project in Godot.
  2. Open 2 scenes and 2 scripts in the editor.
  3. In a terminal, touch those .tscn and .gd files.
  4. Switch back to Godot.
  5. Two "Files have been modified on disk" popups appear on top of each other - one for scripts, and one for scenes and settings files.
  6. Mouse-click "Discard" in the topmost popup.

Expected behavior: The second popup is focused, so you can click "Discard" in that as well to get back to work.

Actual behavior: The Godot window is focused, and the second popup (blocking the godot window) is blurred. You must click once to focus it, and then you can click "Discard".

An even better expected behavior: The two dialogs are merged into one containing all changed files, so a single "Discard" click dismisses them all.

Minimal reproduction project (MRP)

Anything with at least two scenes and two scripts.

lalitshankarchowdhury commented 1 month ago

Error in console:

scene/main/window.cpp:948 - Attempting to make child window exclusive, but the parent window already has another exclusive child. This window: /root/@EditorNode@17036/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@52/@VBoxContainer@53/@EditorMainScreen@98/MainScreen/@WindowWrapper@10625/@ScriptEditor@10624/@ConfirmationDialog@10428, parent window: /root, current exclusive child window: /root/@EditorNode@17036/@Panel@13/@ConfirmationDialog@8364
lalitshankarchowdhury commented 1 month ago

Seems like we need to defer the visibility of a dialog until the latest one has been closed, instead of showing all.