From 49ab1af5425a5e93d79c8e7494a409cd6316e8cc Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 10 Aug 2025 13:11:17 +0200 Subject: [PATCH] Avoid showing the spinner when the predicted display time is close to 0 --- client/scenes/lobby.h | 2 +- client/scenes/lobby_gui.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/scenes/lobby.h b/client/scenes/lobby.h index 54d092d3..e68040ce 100644 --- a/client/scenes/lobby.h +++ b/client/scenes/lobby.h @@ -123,7 +123,7 @@ class lobby : public scene_impl ImTextureID about_picture; ImTextureID default_icon; std::unordered_map app_icons; - XrTime timestamp_start_application{}; + std::optional timestamp_start_application; virtual_keyboard keyboard; diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index b5a61928..ad7e3533 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -246,7 +246,7 @@ void scenes::lobby::gui_connecting(locked_notifiable & pin_req if (next_scene) { current_tab = tab::connected; - timestamp_start_application = 0; + timestamp_start_application.reset(); ImGui::CloseCurrentPopup(); return; } @@ -408,7 +408,7 @@ void scenes::lobby::gui_connected(XrTime predicted_display_time) } else { - bool app_starting = predicted_display_time - timestamp_start_application < 10'000'000'000; + bool app_starting = timestamp_start_application and (predicted_display_time - *timestamp_start_application < 10'000'000'000); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, {20, 0}); ImGui::BeginDisabled(app_starting);