You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix crosshair overlay: video-only, backfill defaults, protect from unrelated saves
Addresses Nir-Az's review comments on PR realsenseai#15093:
- Restrict the grid/crosshair toggle button and rendering to 2D video
streams (profile.as<rs2::video_stream_profile>()), matching the pattern
used elsewhere for stream-details fields. Previously it also rendered on
motion (IMU) streams.
- Backfill viewer_model.grid_overlay.* defaults into pre-existing, non-empty
config files. set_nested_default() already only writes a missing key, so
the is_empty() gate around it was redundant and wrong - it meant the grid
keys were only ever written into a brand-new config file, never into an
existing user's realsense-config.json.
Also fixes a related bug found while testing the above: hand-editing
viewer_model.grid_overlay.* in realsense-config.json while the viewer is
running got silently reverted by the next unrelated config save, because
config_file caches the whole document in memory and every set()/set_nested()
call blindly overwrites the entire file with that stale copy.
Adds config_file::set_protected(), used only by the specific call sites
known to fire often enough to have caused this - the window position/size
callbacks (drag/resize) and processing-block persistence (stream start,
filter enable/disable toggle) - which re-adopt the on-disk grid_overlay
section before writing. Every other config_file caller (device options, DDS
settings, calibration timestamps, ...) is unaffected and pays no extra I/O.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments