Fix to render window flash problem after resizing (in python environment only) #1048
+1
−18
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.
This fix is a prelude of VisualizationFrame python API (#640)
The code related to
render_windowexpose event was dated back near the beginning of rviz2:exposeEvent()(2ca8c2c)impl_->resize()insideexposeEvent(), thus causing this issue although python API was not yet introduced (f0bee03)impl_->resize(0, 0)that seems could be removed (847a552) (because of the isExposed() condition,impl_->resize()is not called at the start (as observed in Python API #640 (comment)). Therefore OGRE window does not have size information to start the rendering, and therefore crashes on macOS due to assertion failure inOgreOSXCocoaWindow.mm, line 410stated in the comment (https://github.com/ros2/rviz/blob/847a5529e2effc96f77843bbe4a33dc7ceea8168/rviz_common/include/rviz_common/render_panel.hpp#L102C54-L102C54). But maybe better leave it here for a while first until there is a chance to test it in macOS)