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

Option button popup menu causes mouse filtering issues in UI. #99735

Closed
btqwrk opened this issue Nov 27, 2024 · 3 comments · Fixed by #99771
Closed

Option button popup menu causes mouse filtering issues in UI. #99735

btqwrk opened this issue Nov 27, 2024 · 3 comments · Fixed by #99771

Comments

@btqwrk
Copy link

btqwrk commented Nov 27, 2024

Tested versions

  • Reproducable in both godot v4.3.stable and v4.2.stable

Will test others as soon as i get a chance!

System information

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 980 (NVIDIA; 32.0.15.6603) - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 Threads)

Issue description

The issue I am experiencing has to do with the option buttons. When you click them, they open a dropdown menu from the class popup menu. All of this happens within a panel with its mouse filter set to stop. Behind the UI is a 3D worldspace with cells that are selectable. When you hover over these cells, they show an extra outline mesh, to give feedback to the player that it's being hovered over. The toggling of the outlining happens via the cell its static body. Using their _mouse_entered and _mouse_exited signals, I call .show() and .hide() on that cell's outline. The expected behavior is to not see any cells get an outline when you hover over the UI, which is what happens - right up untill you open the dropdown menu. Once you do the area within the borders of the dropdown menu seemingly allow the mouse to go through whatever UI element is behind the dropdown menu.

Steps to reproduce

  • Create main Node3d scene

  • Add Camera3D as a child with a freecam script to control the camera.

  • Create a seperate UI scene. Control node (mouse filter on pass if its a full rect) -> Panel (mouse filter on stop, this houses the option button and its popup menu) -> Option Button.

  • Create a cell by adding a mesh, creating a trimesh static body.

  • Add a transparent overlay mesh with a slightly larger scale , and hide it

  • Use the on_mouse_entered and on_mouse_exited signals on the main cell node to show and hide the overlay mesh, to indicate what mesh is being hovered over.

  • Lastly instantiate the ui and a few cells as a child scene in the main 3d world scene you made at step 1.

This should allow you to move around in a world with a few cells, and test the hovering over cells when the UI is before it

Minimal reproduction project (MRP)

godot_option_button_bug_recreation - Copy.zip
Godot_Bug_Recreation_4.2 - Copy.zip

@Sauermann
Copy link
Contributor

Sauermann commented Nov 27, 2024

I have identified the problem and created a PR to fix this. Unfortunately I don't see any workaround besides disabling "Embed Windows" in the main viewport for this problem.

@btqwrk
Copy link
Author

btqwrk commented Nov 27, 2024

Thanks heaps for looking into it!

@btqwrk
Copy link
Author

btqwrk commented Nov 27, 2024

Disabling the "Embed Windows" option works very well for me, thanks for suggesting this!

@akien-mga akien-mga added this to the 4.4 milestone Nov 29, 2024
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