godotengine / godot

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

4.0, FileSystem panel, Renaming file dialog unfocused after alt+tab twice #73821

Open duianto opened 1 year ago

duianto commented 1 year ago

Godot version

v4.0.rc3.official [7e79aead9]

System information

Windows 10 22H2, Compatibility, GeForce GTX 550 Ti

Issue description

Issue: v4.0.rc3.official [7e79aead9]

The FileSystem panels, Renaming file... dialog, loses focus to the main Godot window, when switching (alt + tab) to another application and back (alt + tab) to Godot.

Screen recording:

https://user-images.githubusercontent.com/13420573/220925811-bf83fdca-d511-42dc-a959-05be4eec6d12.mp4

Not an issue: v3.5.2.rc2.official [1a2bf3eb4] and v3.5.1.stable.official [6fed1ffa3]

Screenshot. Godot behaves and looks the same after pressing alt + tab twice.

Godot_v3 5 2-rc2_win64_hoiSD39wuu

Steps to reproduce

Expected

The Renaming file... dialog should become focused again, so that the name can be changed without having to mouse-click on the Renaming file... dialog to focus it manually first.

Observed

The Renaming file... dialog is unfocused, and the main Godot window is focused behind the dialog.

The dialog has to be mouse clicked manually to continue editing the name.

Notes

The behavior in 3.5.x seems better (see the issue description above).

But if the behavior was changed for a specific reason. Then an alternative fix might be to not allow the main Godot window to become focused while a dialog is open.

I can't think of an example at the moment, but I might have seen other applications blink (twice?) the dialogs window (a thick border?) or title bar, when the main window is clicked while a dialog is open.

Possibly to make it more obvious that the open dialog needs to be handled, before the main window can be interacted with, and to make the dialog visible, if, for example, it was moved away to read/see the content behind the dialog.

Minimal reproduction project

issue, renaming file dialog unfocused after alt tab twice.zip

Sauermann commented 1 year ago

v4.1.beta.custom_build [c0d8d91b1] no longer creates a dialog for renaming the file, but creates a LineEdit in the FileSystem panel. Not sure how to replicate this in current master.

duianto commented 1 year ago

Confirmed, the FileSystem panels rename dialog is gone in: v4.1.rc2.official [46424488e]

But I'm seeing the same Alt Tab issue with lots of other (all?) dialog windows. Scene > New Inherited Scene... Project > Project Settings... Editor > Editor Settings... Editor > Command Palette...

Even in the Project Managers Create New Project dialog.

Alt Tabbing away from Godot, and Alt Tabbing back, requires a mouse click to restore keyboard input to the dialog window.

judebert commented 9 months ago

I believe I'm seeing similar behavior in iOS: if the user switches to a different app while a Window is displayed, that Window is closed/hidden. My app pauses the tree when displaying options, and if the user switches away, the app appears frozen when they return.