godotengine / godotengine/godot

FileDialog() file picker does not default to the current_path property when it opens

Open
#89,202 1 comment 0 reactions 0 assignees View on GitHub
documentation topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

v4.3.dev3.official [36e943b6b]

### System information

Linux Kubuntu 23.04 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.104.0 Qt Version: 5.15.8

### Issue description

- When opening a file picker dialog using the `FileDialog` class/node it does not default to the `current_path` (or `current_dir`) property. Issues seems to be with both native and non native dialog.

### Steps to reproduce

Add the following code to an empty `Control` node scene and run it. The native folder picker will open but if does not position nor select the `current_path`. What it should do, is display and position to the folder as specified in `current_path`. Same issue happens with the godot file picker (setting `file_dialog.use_native_dialog=false`)

```python
extends Control

var default_dir='/home'
var file_dialog:FileDialog

func _ready():
ProjectSettings.set_setting("display/window/subwindows/embed_subwindows", false)
file_dialog=FileDialog.new()
file_dialog.visible=false
#file_dialog.use_native_dialog=false
file_dialog.use_native_dialog=true
file_dialog.current_dir=default_dir
file_dialog.access=FileDialog.ACCESS_FILESYSTEM
file_dialog.file_mode=FileDialog.FILE_MODE_OPEN_DIR
add_child(file_dialog)
file_dialog.visible=true
pass # Replace with function body.
```

### Minimal reproduction project (MRP)

see code above

Contributor guide

Open the contributing guide

Research direction

Start at the FileDialog entry points for opening native and non-native dialogs, using the supplied GDScript reproduction with current_dir=/home. Verify both dialog types open at and select current_dir; done when the behavior matches the requested path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.