[fix] fix black screen after close the connection

This commit is contained in:
dijunkun
2024-09-13 10:35:53 +08:00
parent 0c688efaee
commit a49ca813e0
2 changed files with 5 additions and 4 deletions

View File

@@ -503,7 +503,8 @@ int Render::Run() {
ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always);
ImGui::SetNextWindowSize(
ImVec2(main_window_width_,
streaming_ ? (fullscreen_button_pressed_ ? 0 : title_bar_height_)
(connection_established_ && streaming_ && is_client_mode_)
? (fullscreen_button_pressed_ ? 0 : title_bar_height_)
: main_window_height_default_),
ImGuiCond_Always);
ImGui::Begin("Render", nullptr,
@@ -516,7 +517,7 @@ int Render::Run() {
TitleBar();
}
if (streaming_ && is_client_mode_) {
if (connection_established_ && streaming_ && is_client_mode_) {
if (!resizable_) {
resizable_ = !resizable_;
SDL_SetWindowResizable(main_window_, SDL_TRUE);