mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-03-28 20:45:32 +08:00
[fix] fix incorrect data send function used for control data
This commit is contained in:
@@ -1376,8 +1376,8 @@ void Render::MainLoop() {
|
|||||||
remote_action.i.host_name_size = host_name.size();
|
remote_action.i.host_name_size = host_name.size();
|
||||||
|
|
||||||
std::string msg = remote_action.to_json();
|
std::string msg = remote_action.to_json();
|
||||||
int ret = SendDataFrame(peer_, msg.data(), msg.size(),
|
int ret = SendReliableDataFrame(peer_, msg.data(), msg.size(),
|
||||||
control_data_label_.c_str());
|
control_data_label_.c_str());
|
||||||
FreeRemoteAction(remote_action);
|
FreeRemoteAction(remote_action);
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
need_to_send_host_info_ = false;
|
need_to_send_host_info_ = false;
|
||||||
@@ -1897,6 +1897,12 @@ void Render::ProcessSdlEvent(const SDL_Event& event) {
|
|||||||
foucs_on_main_window_ = false;
|
foucs_on_main_window_ = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SDL_EVENT_DROP_FILE:
|
||||||
|
if (stream_window_ &&
|
||||||
|
SDL_GetWindowID(stream_window_) == event.window.windowID) {
|
||||||
|
printf("SDL_EVENT_DROP_FILE (%s)\n", event.drop.data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case SDL_EVENT_MOUSE_MOTION:
|
case SDL_EVENT_MOUSE_MOTION:
|
||||||
case SDL_EVENT_MOUSE_BUTTON_DOWN:
|
case SDL_EVENT_MOUSE_BUTTON_DOWN:
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class Render {
|
|||||||
Params params_;
|
Params params_;
|
||||||
PeerPtr* peer_ = nullptr;
|
PeerPtr* peer_ = nullptr;
|
||||||
std::string audio_label_ = "control_audio";
|
std::string audio_label_ = "control_audio";
|
||||||
std::string data_label_ = "control_data";
|
std::string data_label_ = "data";
|
||||||
std::string file_label_ = "file";
|
std::string file_label_ = "file";
|
||||||
std::string control_data_label_ = "control_data";
|
std::string control_data_label_ = "control_data";
|
||||||
std::string file_feedback_label_ = "file_feedback";
|
std::string file_feedback_label_ = "file_feedback";
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
|
|||||||
remote_action.d = i;
|
remote_action.d = i;
|
||||||
if (props->connection_status_ == ConnectionStatus::Connected) {
|
if (props->connection_status_ == ConnectionStatus::Connected) {
|
||||||
std::string msg = remote_action.to_json();
|
std::string msg = remote_action.to_json();
|
||||||
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
|
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
|
||||||
props->control_data_label_.c_str());
|
props->control_data_label_.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
props->display_selectable_hovered_ = ImGui::IsWindowHovered();
|
props->display_selectable_hovered_ = ImGui::IsWindowHovered();
|
||||||
@@ -176,8 +176,8 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
|
|||||||
remote_action.type = ControlType::audio_capture;
|
remote_action.type = ControlType::audio_capture;
|
||||||
remote_action.a = props->audio_capture_button_pressed_;
|
remote_action.a = props->audio_capture_button_pressed_;
|
||||||
std::string msg = remote_action.to_json();
|
std::string msg = remote_action.to_json();
|
||||||
SendDataFrame(props->peer_, msg.c_str(), msg.size(),
|
SendReliableDataFrame(props->peer_, msg.c_str(), msg.size(),
|
||||||
props->control_data_label_.c_str());
|
props->control_data_label_.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user