From d963a0cf38a1831761c23be7439e8a0c617a400c Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 14 Jun 2024 10:48:35 +0800 Subject: [PATCH] 1.The mouse control button allowed to be clicked Only when connection established; 2.Fix display resolution error after exit fullscreen --- src/main_window/main_window.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main_window/main_window.cpp b/src/main_window/main_window.cpp index aaa0d66..0654a00 100644 --- a/src/main_window/main_window.cpp +++ b/src/main_window/main_window.cpp @@ -532,10 +532,11 @@ int MainWindow::Run() { ImGui::Separator(); ImGui::Spacing(); - + // Mouse control if (ImGui::Button(mouse_control_button_label_.c_str())) { if (mouse_control_button_label_ == - localization::control_mouse[localization_language_index_]) { + localization::control_mouse[localization_language_index_] && + connection_established_) { mouse_control_button_pressed_ = true; control_mouse_ = true; mouse_control_button_label_ = @@ -548,7 +549,7 @@ int MainWindow::Run() { } ImGui::SameLine(); - + // Fullscreen if (ImGui::Button(fullscreen_button_label_.c_str())) { if (fullscreen_button_label_ == localization::fullscreen[localization_language_index_]) { @@ -561,6 +562,8 @@ int MainWindow::Run() { SDL_SetWindowFullscreen(main_window_, SDL_FALSE); SDL_SetWindowSize(main_window_, main_window_width_before_fullscreen_, main_window_height_before_fullscreen_); + main_window_width_ = main_window_width_before_fullscreen_; + main_window_height_ = main_window_height_before_fullscreen_; fullscreen_button_label_ = localization::fullscreen[localization_language_index_]; }