From 06d771b89e85733bac9f7a068003c9a80080d307 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Feb 2026 23:36:17 +0100 Subject: [PATCH] Fix flickering screen after disconnect Deleting the stream object has to be delayed until all Vulkan work is done. --- client/scenes/lobby_gui.cpp | 2 +- client/scenes/stream.cpp | 2 +- client/scenes/stream.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index 4c76eaf7..0985c53e 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -257,7 +257,7 @@ void scenes::lobby::gui_connected(XrTime predicted_display_time) if (next_scene->apps.draw_gui(*imgui_ctx, _("Disconnect")) == app_launcher::Cancel) { - next_scene.reset(); + next_scene->exit(); current_tab = tab::server_list; } } diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index 13ba27c8..5168284b 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -769,7 +769,7 @@ void scenes::stream::render(const XrFrameState & frame_state) last_display_time = frame_state.predictedDisplayTime; std::shared_lock lock(decoder_mutex); - if (not frame_state.shouldRender or (decoders[0].empty() and decoders[1].empty())) + if (not frame_state.shouldRender or (decoders[0].empty() and decoders[1].empty()) or exiting) { // TODO: stop/restart video stream session.begin_frame(); diff --git a/client/scenes/stream.h b/client/scenes/stream.h index c05602cd..2a526784 100644 --- a/client/scenes/stream.h +++ b/client/scenes/stream.h @@ -218,6 +218,7 @@ public: return state_; } + void exit(); bool alive() const { return !exiting; @@ -236,7 +237,6 @@ private: void setup(const to_headset::video_stream_description &); void setup_reprojection_swapchain(uint32_t width, uint32_t height); - void exit(); vk::raii::QueryPool query_pool = nullptr; bool query_pool_filled = false;