-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
window_get_popup_safe_rect error on popups in viewport #73413
Comments
In the inner viewport, p_window = -1. For the normal popup (not inside the subviewport) the window id is 0. |
The only place window_id is set to anything other than -1 or 0 (main window) is in _make_window. _make_window is called in _notification when the node enters the tree (NOTIFICATION_ENTER_TREE), but ONLY if it's not embedded. Secondly however, if visible is set to true, the node is not currently visible, and the node is inside the tree, and it has an embedder (embedder_vp), and the window id is currently invalid(-1), it will generate a window ID. I believe So it looks like it's creating the OS window, but never setting the window ID. |
While investigating
I don't think, that this function has any problems related to this bugreport. It returns the |
Ok sorry, first day in the codebase. Thanks so much for looking into it. Popups are used constantly (think Runescape) so it's a pretty bad error on our side. If it's any help, getting the popup to show in the right spot (under the cursor) was also quite the challenge. This is called from a node inside of the subviewport (popup menu is a child of said node):
|
Godot version
4.0.RC2
System information
Windows 10, M1 Macbook Air
Issue description
When closing a popup that was opened within a SubViewport, the following message appears:
Note on windows, you get a similar error, but for display_server_windows.
Steps to reproduce
Put a button in a sub viewport.
Put a popup menu under the button.
Call popup() on the popup menu.
Click outside of the popup menu to close it.
Minimal reproduction project
PopupBug.zip
Upon running, click on the two buttons to show the two popups.
Notice the popup outside of the viewport doesn't throw an error, but the one inside it does.
The text was updated successfully, but these errors were encountered: