-
-
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
PopupMenu throws signal connection errors on release build #87626
Comments
Ops, i was thinking binary exported for windows not affected, but my latest windows builds has the same bug. Possibly it reproduces a bit randomly, or I just messed up. |
I'm using 4.2.1 stable and getting the same error message as the first on exported projects. Not sure about OptionButtons, but it's happened to me and other people testing the exported project upon hovering over a UI element with a tooltip, and then moving the mouse cursor away and closing the tooltip. |
Yes, can reproduce it with tooltip and seems it all the same bug. Except tooltip has problem on closing only, popup menu on both open and close event. |
I ran into this same issue on a project I am working on. After the better part of a day of unsuccessfully trying to work around it, I started digging into the engine's source code to find the issue. I ended up cloning the repo, making a few changes, and building Godot from source. My custom Godot binary did get rid of the errors listed above. That said, at this time I do not plan to submit a PR with my changes. I am not a C++ developer, and I don't know for sure that my changes didn't introduce a new bug somewhere else. Furthermore, CONTRIBUTING.md suggests that any pull requests should include unit tests to cover the changes, which I can't really do. I am sharing my changes in hopes that someone better than I am at C++ will be able to use it to get a head start on fixing this bug and closing the issue. Anyway, I think the problem lies in So, I changed these two functions in void Popup::_initialize_visible_parents() {
if (is_embedded()) {
visible_parents.clear();
Window *parent_window = this->get_parent_visible_window();
while (parent_window) {
visible_parents.push_back(parent_window);
Callable focus_entered_callable = callable_mp(this, &Popup::_parent_focused);
Callable tree_exited_callable = callable_mp(this, &Popup::_deinitialize_visible_parents);
if (!parent_window->is_connected(SceneStringName(focus_entered), focus_entered_callable)) {
parent_window->connect(SceneStringName(focus_entered), focus_entered_callable);
}
if (!parent_window->is_connected(SceneStringName(tree_exited), tree_exited_callable)) {
parent_window->connect(SceneStringName(tree_exited), tree_exited_callable);
}
parent_window = parent_window->get_parent_visible_window();
}
}
}
void Popup::_deinitialize_visible_parents() {
if (is_embedded()) {
for (Window *parent_window : visible_parents) {
Callable focus_entered_callable = callable_mp(this, &Popup::_parent_focused);
Callable tree_exited_callable = callable_mp(this, &Popup::_deinitialize_visible_parents);
if (parent_window->is_connected(SceneStringName(focus_entered), focus_entered_callable)) {
parent_window->disconnect(SceneStringName(focus_entered), focus_entered_callable);
}
if (parent_window->is_connected(SceneStringName(tree_exited), tree_exited_callable)) {
parent_window->disconnect(SceneStringName(tree_exited), tree_exited_callable);
}
}
visible_parents.clear();
}
} As I mentioned above, compiling from the current I hope this helps get this bug fixed in the final 4.3 release. |
Ammended to fix formatting issues
Ammended to fix formatting issues
Ammended to fix formatting issues
Tested versions
4.2.stable
4.3 dev2
System information
Godot v4.2.1.stable - Manjaro Linux 23.1.3 - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT (RADV NAVI22) () - Intel(R) Xeon(R) CPU E5-2697 v3 @ 2.60GHz (28 Threads)
Issue description
Project release exported for linux throws some errors when user interact with OptionButton and its PopupMenu.
Every time when opened popup menu closing:
When menu opening after been closed prevously (so every time excluding the very first opening):
This doesn't reproduces in editor.
This doesn't reproduces for web export .
This doesn't reproduces when project exported with debug option.
This doesn't reproduces when project settnig
display/window/subwindows/embed_subwindows
disabled.All popup menu features works normally as far I as can tell, but this error spam in logs is kinda annoying.
Steps to reproduce
Minimal reproduction project (MRP)
Absolutely trivial project with OptionButton as one and only element in single scene.
option_button_project.zip
The text was updated successfully, but these errors were encountered: