Removed was-open check for ComboBox to fix freeze on macOS #6178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As already described in #6024, on macOS the combobox was freezing when it was opened.
Motivation and Context
At the moment it is not possible to select an item from a Combobox on macOS. This does not work in the Open3D App and also any other app using the Open3D GUI library.
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
It seems that the problem is the following: On macOS the ImGUI method
ImGui::IsPopupOpen
always returnsfalse
and so does leads to a return of ofWidget::DrawResult::REDRAW
which causes the GUI to redraw itself, which will go on for ever.To be honest, I am not quite sure why this check is done, maybe to change to combobox content if it has been changed while the user has the dropdown open (@errissa)?
Since it worked in version
0.15.0
I first thought it is an ImGUI problem, but the ImGUI version did not change from 0.15.0 to 0.16.0. And even with a more recent version (v1.88
) it does not work. Because this bug has a big impact to any GUI (you can not even fully use the open3d app on macOS), I decided to fix it directly in Open3d. Maybe it makes sense to open an issue at ImGUI so that it will be fixed in a future release.To fix the issue in Open3D, I have removed this check and simplified to redrawing to just redraw, when the selection has changed.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)