[fix] do not send mouse click event when cursor is on control bar and display selectable

This commit is contained in:
dijunkun
2025-05-16 19:06:25 +08:00
parent abc6b17a3b
commit 9138ca771f
3 changed files with 3 additions and 1 deletions

View File

@@ -70,6 +70,7 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
sizeof(remote_action), props->data_label_.c_str()); sizeof(remote_action), props->data_label_.c_str());
} }
} }
props->display_selectable_hovered_ = ImGui::IsWindowHovered();
} }
ImGui::SetWindowFontScale(1.0f); ImGui::SetWindowFontScale(1.0f);
ImGui::EndPopup(); ImGui::EndPopup();

View File

@@ -50,6 +50,7 @@ class Render {
bool streaming_ = false; bool streaming_ = false;
bool is_control_bar_in_left_ = true; bool is_control_bar_in_left_ = true;
bool control_bar_hovered_ = false; bool control_bar_hovered_ = false;
bool display_selectable_hovered_ = false;
bool control_bar_expand_ = true; bool control_bar_expand_ = true;
bool reset_control_bar_pos_ = false; bool reset_control_bar_pos_ = false;
bool control_window_width_is_changing_ = false; bool control_window_width_is_changing_ = false;

View File

@@ -91,7 +91,7 @@ int Render::ProcessMouseEvent(SDL_Event &event) {
remote_action.m.flag = MouseFlag::move; remote_action.m.flag = MouseFlag::move;
} }
if (props->control_bar_hovered_) { if (props->control_bar_hovered_ || props->display_selectable_hovered_) {
remote_action.m.flag = MouseFlag::move; remote_action.m.flag = MouseFlag::move;
} }
SendDataFrame(props->peer_, (const char *)&remote_action, SendDataFrame(props->peer_, (const char *)&remote_action,