Skip to content

Commit 17d4ef9

Browse files
committed
Hide dummy OGRE render window on macOS
The initialization render window created by Ogre2RenderEngine for GPU resource setup (HLMS, compositor) was visible on macOS as a blank 'OgreWindow(0)_0' window. This window serves no purpose after initialization and can be safely closed by the user without affecting rendering. Two changes: 1. Pass params["hidden"] = "true" when creating the dummy window. Both Metal (OgreMetalWindow) and GL3Plus (OgreOSXCocoaWindow) backends already support this parameter. 2. Guard _setVisible(true) to only apply to real render windows (width/height > 1), preventing the dummy window from being re-shown after creation. Tested on macOS 26 (Tahoe) with Apple M4, Gazebo Harmonic 8.10.0 via conda-forge/RoboStack packages. Signed-off-by: Aldrin Inbaraj <aldrininbaraj@gmail.com> Generated-by: Claude (Anthropic)
1 parent de3911f commit 17d4ef9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ogre2/src/Ogre2RenderEngine.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ std::string Ogre2RenderEngine::CreateRenderWindow(const std::string &_handle,
12221222

12231223
// Hide window if dimensions are less than or equal to one.
12241224
params["border"] = "none";
1225+
params["hidden"] = "true";
12251226

12261227
std::ostringstream stream;
12271228
stream << "OgreWindow(0)" << "_" << _handle;
@@ -1299,10 +1300,15 @@ std::string Ogre2RenderEngine::CreateRenderWindow(const std::string &_handle,
12991300

13001301
if (this->window)
13011302
{
1302-
this->window->_setVisible(true);
1303+
// Only show and reposition the window if it was not created as a
1304+
// hidden dummy window (e.g. for render-to-texture initialization).
1305+
if (_width > 1u && _height > 1u)
1306+
{
1307+
this->window->_setVisible(true);
13031308

1304-
// Windows needs to reposition the render window to 0,0.
1305-
this->window->reposition(0, 0);
1309+
// Windows needs to reposition the render window to 0,0.
1310+
this->window->reposition(0, 0);
1311+
}
13061312
}
13071313
return stream.str();
13081314
}

0 commit comments

Comments
 (0)