diff --git a/patch/ros-rolling-rviz-rendering.osx.patch b/patch/ros-rolling-rviz-rendering.osx.patch new file mode 100644 index 00000000..b7a8ede3 --- /dev/null +++ b/patch/ros-rolling-rviz-rendering.osx.patch @@ -0,0 +1,46 @@ +diff --git a/src/rviz_rendering/ogre_render_window_impl.cpp b/src/rviz_rendering/ogre_render_window_impl.cpp +index 466e1d1e4..8fcd56d57 100644 +--- a/src/rviz_rendering/ogre_render_window_impl.cpp ++++ b/src/rviz_rendering/ogre_render_window_impl.cpp +@@ -235,12 +235,21 @@ void + RenderWindowImpl::resize(size_t width, size_t height) + { + if (ogre_render_window_) { +- this->setCameraAspectRatio(); +- ogre_render_window_->resize( +- static_cast(width), // NOLINT +- static_cast(height) // NOLINT +- ); +- ogre_render_window_->windowMovedOrResized(); ++ // Skip the costly Ogre resize / windowMovedOrResized when the size has ++ // not actually changed. On macOS Sonoma+, windowMovedOrResized triggers ++ // [NSOpenGLContext update] -> CGLSetVirtualScreen, which is hundreds of ++ // ms per call under the OpenGL-on-Metal compatibility path; each call ++ // also re-fires an expose event, so calling it on every expose creates ++ // a positive-feedback loop that makes the splash screen never progress. ++ const auto w = static_cast(width); ++ const auto h = static_cast(height); ++ if (w != last_resize_width_ || h != last_resize_height_) { ++ last_resize_width_ = w; ++ last_resize_height_ = h; ++ this->setCameraAspectRatio(); ++ ogre_render_window_->resize(w, h); ++ ogre_render_window_->windowMovedOrResized(); ++ } + } + this->renderLater(); + } +diff --git a/src/rviz_rendering/ogre_render_window_impl.hpp b/src/rviz_rendering/ogre_render_window_impl.hpp +index 7bd7b2238..8391498fe 100644 +--- a/src/rviz_rendering/ogre_render_window_impl.hpp ++++ b/src/rviz_rendering/ogre_render_window_impl.hpp +@@ -150,6 +150,9 @@ protected: + + bool animating_; + ++ unsigned int last_resize_width_{0}; ++ unsigned int last_resize_height_{0}; ++ + Ogre::Viewport * ogre_viewport_; + + // std::function pre_render_callback_; ///< Functor which is called before each render diff --git a/pkg_additional_info.yaml b/pkg_additional_info.yaml index 629ed496..b612a547 100644 --- a/pkg_additional_info.yaml +++ b/pkg_additional_info.yaml @@ -171,3 +171,6 @@ compressed_depth_image_transport: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" moveit_ros_visualization: additional_cmake_args: "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" +# Remove all lines after this one on new full rebuild +rviz_rendering: + build_number: 19