diff --git a/src/xrt/state_trackers/gui/gui_common.h b/src/xrt/state_trackers/gui/gui_common.h index eb86dbbff..bb4228d2e 100644 --- a/src/xrt/state_trackers/gui/gui_common.h +++ b/src/xrt/state_trackers/gui/gui_common.h @@ -224,10 +224,11 @@ gui_scene_record(struct gui_program *p, const char *camera); /*! * Remote control debugging UI. * + * @param Optional address. * @ingroup gui */ void -gui_scene_remote(struct gui_program *p); +gui_scene_remote(struct gui_program *p, const char *address); /*! * Given the frameserver runs the calibration code on it. diff --git a/src/xrt/state_trackers/gui/gui_scene_main_menu.c b/src/xrt/state_trackers/gui/gui_scene_main_menu.c index c39bbe4de..fd5d9d418 100644 --- a/src/xrt/state_trackers/gui/gui_scene_main_menu.c +++ b/src/xrt/state_trackers/gui/gui_scene_main_menu.c @@ -74,7 +74,7 @@ scene_render(struct gui_scene *scene, struct gui_program *p) if (igButton("Remote", button_dims)) { gui_scene_delete_me(p, scene); - gui_scene_remote(p); + gui_scene_remote(p, NULL); } igSeparator(); diff --git a/src/xrt/state_trackers/gui/gui_scene_remote.c b/src/xrt/state_trackers/gui/gui_scene_remote.c index cf06e4254..f6d223f01 100644 --- a/src/xrt/state_trackers/gui/gui_scene_remote.c +++ b/src/xrt/state_trackers/gui/gui_scene_remote.c @@ -387,7 +387,7 @@ scene_destroy(struct gui_scene *scene, struct gui_program *p) */ void -gui_scene_remote(struct gui_program *p) +gui_scene_remote(struct gui_program *p, const char *address) { struct gui_remote *gr = U_TYPED_CALLOC(struct gui_remote); @@ -396,7 +396,11 @@ gui_scene_remote(struct gui_program *p) gr->rc.fd = -1; // GUI input defaults. - snprintf(gr->address, sizeof(gr->address), "localhost"); + if (address != NULL) { + snprintf(gr->address, sizeof(gr->address), "%s", address); + } else { + snprintf(gr->address, sizeof(gr->address), "localhost"); + } gr->port = 4242; gui_scene_push_front(p, &gr->base); diff --git a/src/xrt/targets/gui/gui_sdl2_main.c b/src/xrt/targets/gui/gui_sdl2_main.c index 08affee0e..2a16e805b 100644 --- a/src/xrt/targets/gui/gui_sdl2_main.c +++ b/src/xrt/targets/gui/gui_sdl2_main.c @@ -47,7 +47,7 @@ main(int argc, char **argv) } else if (argc >= 2 && strcmp("record", argv[1]) == 0) { gui_scene_record(&p.base, argc >= 3 ? argv[2] : NULL); } else if (argc >= 2 && strcmp("remote", argv[1]) == 0) { - gui_scene_remote(&p.base); + gui_scene_remote(&p.base, argc >= 3 ? argv[2] : NULL); } else { gui_scene_main_menu(&p.base); }