[fix] fix window size when closed after resized

This commit is contained in:
dijunkun
2024-09-12 13:51:11 +08:00
parent fea545e5e7
commit 4e4e84ae4d

View File

@@ -558,7 +558,8 @@ int Render::Run() {
received_frame_ = false; received_frame_ = false;
is_client_mode_ = false; is_client_mode_ = false;
audio_capture_button_pressed_ = false; audio_capture_button_pressed_ = false;
SDL_RestoreWindow(main_window_); SDL_SetWindowSize(main_window_, main_window_width_default_,
main_window_height_default_);
continue; continue;
} else { } else {
LOG_INFO("Quit program"); LOG_INFO("Quit program");
@@ -612,7 +613,8 @@ int Render::Run() {
} }
} else if (event.type == REFRESH_EVENT) { } else if (event.type == REFRESH_EVENT) {
if (stream_texture_) if (stream_texture_)
if (video_width_ != texture_width_) { if (video_width_ != texture_width_ ||
video_height_ != texture_height_) {
texture_width_ = video_width_; texture_width_ = video_width_;
texture_height_ = video_height_; texture_height_ = video_height_;