From b7947e0573e8fda842d6eccc3569f4941eaa51d4 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 19 Nov 2026 16:46:56 -0700 Subject: [PATCH] Fit RViz's window to the Mac's virtual display The RViz configs keep the lab monitors' window geometry (the H1-2's at x = 1990, 1245x1376), so on the Mac's 1280x800 Xvfb display RViz drew entirely off-screen and noVNC showed black. vnc_display.sh now starts matchbox-window-manager, which fits each window to the screen; checked in a fresh golem_ros container: RViz at 1280x800+0+0. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015EG7pDNJLWR31eQmyKaWhr --- docker/mac/RosDockerfile | 4 +++- docker/mac/vnc_display.sh | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/mac/RosDockerfile b/docker/mac/RosDockerfile index 942a40a..b6b9ef6 100644 --- a/docker/mac/RosDockerfile +++ b/docker/mac/RosDockerfile @@ -163,8 +163,10 @@ RUN rm -rf /usr/local/lib/python3.10/dist-packages/setuptools \ # RViz's display: Xvfb with Mesa's software OpenGL, shown over VNC (x11vnc) and # in a browser (noVNC on websockify), started by vnc_display.sh, the entrypoint. # A Mac has no X server a container can render OpenGL through (docs/MAC.md). +# matchbox-window-manager fits each window to the screen: the RViz configs keep +# the lab monitors' window geometry, which lies off a 1280x800 display. RUN apt-get update && apt-get install -y --no-install-recommends \ - xvfb x11vnc novnc python3-websockify \ + xvfb x11vnc novnc python3-websockify matchbox-window-manager \ && rm -rf /var/lib/apt/lists/* COPY docker/mac/vnc_display.sh /opt/golem/vnc_display.sh ENTRYPOINT ["/opt/golem/vnc_display.sh"] diff --git a/docker/mac/vnc_display.sh b/docker/mac/vnc_display.sh index e5d959b..b772ed8 100755 --- a/docker/mac/vnc_display.sh +++ b/docker/mac/vnc_display.sh @@ -7,7 +7,9 @@ # A Mac has no X server a container can render through (XQuartz gives no # OpenGL on Apple Silicon), so RViz draws on Xvfb display :99 with Mesa's # software OpenGL (llvmpipe), shown by x11vnc on port 5901 and by noVNC in a -# browser on port 6080. The containers run on the VM's host network, which +# browser on port 6080; matchbox-window-manager fits each window to the screen +# (the RViz configs keep the lab monitors' window geometry, off this display). +# The containers run on the VM's host network, which # OrbStack and Docker Desktop forward to the Mac's localhost: # http://localhost:6080/vnc.html or vnc://localhost:5901 (Screen Sharing) # Environment: DISPLAY (:99, docker-compose.mac.yml); GOLEM_VNC=0 starts no @@ -33,6 +35,7 @@ start_display() { echo "vnc_display: Xvfb did not start on $display (/tmp/xvfb.log)" >&2 return 0 fi + DISPLAY=$display matchbox-window-manager -use_titlebar no >/tmp/wm.log 2>&1 & # No password: the VM's network is reachable only from the Mac. x11vnc -display "$display" -rfbport 5901 -forever -shared -nopw -quiet \ >/tmp/x11vnc.log 2>&1 &