Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior of the Exclusive property in the Popup class #4081

Open
98teg opened this issue Aug 5, 2020 · 3 comments
Open

Unexpected behavior of the Exclusive property in the Popup class #4081

98teg opened this issue Aug 5, 2020 · 3 comments
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository

Comments

@98teg
Copy link

98teg commented Aug 5, 2020

Godot version:

3.2 Branch, commit godotengine/godot#40914

OS/device including version:

OpenGL ES 3.0 Renderer: GeForce GTX 1050 Ti/PCIe/SSE2

Issue description:

I was creating a FileDialog and I wanted to force the user to select a file. I set the Exclusive property on the Popup class to true. However, this only ensures the Popup not to hide when clicking outside the Popup window. The Popup window still closes when pressing X or the cancel button, despite the documentation stating:

If true, the popup will not be hidden when a click event occurs outside of it, or when it receives the ui_cancel action event.

So I suggest changing the documentation to better explain this behavior or to change this behavior.

Steps to reproduce:
Add a child to a Control Node that is a WindowDialog named Popup, sets its Exclusive property to activated and add a script to the parent with this code:

extends Control

func _ready():
	get_node("Popup").popup_centered()

Then, when executing the project, it is possible to close the WindowDialog when pressing X.
Minimal reproduction project:

Dialog.zip

@98teg
Copy link
Author

98teg commented Aug 5, 2020

I was able to work around this getting the buttons using get_close_button() and get_cancel(). Then I disabled those buttons. So I'm not sure if I should close this issue.

@Zireael07
Copy link

The documentation doesn't state that it doesn't react to X or cancel button, just not to mouse clicks outside and the input action event ui_cancel (usually the Escape key).

@98teg
Copy link
Author

98teg commented Aug 5, 2020

I later thought about that may be the case, but at first glance, I thought it refers to those buttons. May I suggest adding something along the lines This property does not affect the close or cancel button of the dialogs that inherits from this class?

Calinou referenced this issue in Calinou/godot Aug 5, 2020
@NathanLovato NathanLovato transferred this issue from godotengine/godot Sep 27, 2020
@skyace65 skyace65 added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository
Projects
None yet
Development

No branches or pull requests

3 participants