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

enable OptionButton to work from vr-simulator #532

Conversation

goatchurchprime
Copy link
Contributor

When trying to click on an OptionButton using the xr-simulator add-on they never popup. This seems to be due to it receiving double clicks.

I don't know exactly what this push_event function is doing as a lot of events go through it that don't get into the UI (when not holding down the E key in the simulator), but I think it's responsible for duplicate clicks going through and immediately closing the popup.

There's something problematic happening in the implementation, as reported at: godotengine/godot#81579 (comment)

(The other bug where the popup remains activated and pops up again if you had selected the option in the mode of a click release is still there after this change.)

@BastiaanOlij
Copy link
Member

Godot 4's new multiple window support broke a number of things around viewports and events properly being handled because a lot of the UI elements assume subviewports are presented through subviewportcontainers and are thus purely 2D.
The GUI in 3D logic has become very dodgy, see also: godotengine/godot#77189

That said, in XR obviously you don't have a lot of input to worry about, we're using controllers that emulate mouse actions directly on screen. The simulator breaks that so there are limitations to what we can fix without breaking our primary goal, logic working in XR. As an alternative, try out the new XR simulator Meta released so you properly emulate OpenXR without needing a headset.

That all said, I'm happy to accept this fix, we're not expecting mouse input, and the mouse emulation is handled inside of the component. If filtering out mouse events takes away the pain, everyone wins. I would recommend adding a good comment in the code to explain why mouse events are being filtered out.

@BastiaanOlij BastiaanOlij added the bug Something isn't working label Oct 3, 2023
@BastiaanOlij BastiaanOlij added this to the 4.3.0 milestone Oct 3, 2023
Copy link
Member

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@BastiaanOlij BastiaanOlij merged commit b87b783 into GodotVR:master Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants