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

CenterContainer blocks parent from receiving drag and drop #34933

Closed
ForLoveOfCats opened this issue Jan 8, 2020 · 2 comments · Fixed by #35068
Closed

CenterContainer blocks parent from receiving drag and drop #34933

ForLoveOfCats opened this issue Jan 8, 2020 · 2 comments · Fixed by #35068

Comments

@ForLoveOfCats
Copy link
Contributor

Godot version:
Godot (Mono*) 3.2 Beta 5
*The reproduction project uses GDScript to demonstrate the issue

OS/device including version:
Manjaro Linux x86_64

Issue description:
When the mouse drag is released over a CenterContainer it prevents its parent from receiving the drag data.

Steps to reproduce:
See reproduction project + explanation

Minimal reproduction project:
DragAndDrop.zip
When dragging on the grey Panel the number 42 is given to Godot as the drag data. When it is released on the left side of the screen the HBoxContainer receives this and prints it. However when released on the right side of the screen the CenterContainer instead blocks it. The VBoxContainers on both sides of the screen do not exhibit this behavior.

@KoBeWi
Copy link
Member

KoBeWi commented Jan 12, 2020

That's because your CenterContainer has mouse_filter set to Stop. When it's set to Pass (same as BoxContainers), it works correctly.

Although I wonder why CenterContainer's default is different. It's still a container.

@akien-mga
Copy link
Member

Although I wonder why CenterContainer's default is different. It's still a container.

mouse_filter defaults to MOUSE_FILTER_STOP in Control, which Container and thus CenterContainer inherit.
BoxContainer and GridContainer seem to have local overrides to MOUSE_FILTER_PASS. The discrepancy is probably not intended.

akien-mga added a commit to akien-mga/godot that referenced this issue Jan 13, 2020
Containers are meant to forward mouse input to their the Controls
they contain.

PanelContainer has a visible Panel stylebox, so it still defaults
to STOP.

Fixes godotengine#34933.
@akien-mga akien-mga added this to the 4.0 milestone Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants