Skip to content

DisplayServer.dialog_show does nothing in exported projects on Windows #111278

@lostminds

Description

@lostminds

Tested versions

Reproducible in 4.5-stable not reproducible in 4.4.1

System information

Godot v4.5.stable - Windows 11 (build 26100) - Multi-window, 1 monitor - OpenGL 3 (Compatibility)

Issue description

DisplayServer.dialog_show can be used on OSes that have this feature (like Windows and macOS) to show a native OS style dialog popup with options. Useful for confirmation or unsaved changes style dialogs.

However, in 4.5 this has stopped working on Windows in exported projects, and instead it does nothing. No errors, just nothing happens. It still works as far as I can tell on macOS in exported builds and it also still works as expected on Windows when running the project from the editor.

While dialog_show might not be used that often this is quite a serious issue if you're using it since it's hard to see, as it doesn't show up when testing from the editor. And it can lock your projects in invalid states as prompts like this often put apps in a modal state where it expects the dialog callbacks to be called to proceed.

Steps to reproduce

Have a simple setup project where pressing a button calls the dialog_show. For example:

func _on_button_pressed() -> void:
	DisplayServer.dialog_show("Test","Message",["Button 1","Button 2"],dialog_callback)
	
func dialog_callback(selected_button:int) -> void:
	print("dialog_callback selected_option:"+str(selected_button))

Run project from editor and press button to observe it works.

in_editor.mp4

Export the project (with all default settings) on windows and run the exported project
Pressing the button nothing happens, also included output console to show there are no errors when this happens.

exported.mp4

Minimal reproduction project (MRP)

NativeDialogTest.zip

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions