mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-03-26 03:07:30 +08:00
[fix] fix incorrect online status of recently connections
This commit is contained in:
@@ -227,14 +227,8 @@ int Render::ShowRecentConnections() {
|
|||||||
if (ImGui::Button(connect_to_this_connection_button_name.c_str(),
|
if (ImGui::Button(connect_to_this_connection_button_name.c_str(),
|
||||||
ImVec2(recent_connection_button_width,
|
ImVec2(recent_connection_button_width,
|
||||||
recent_connection_button_height))) {
|
recent_connection_button_height))) {
|
||||||
if (online) {
|
|
||||||
ConnectTo(it.second.remote_id, it.second.password.c_str(),
|
ConnectTo(it.second.remote_id, it.second.password.c_str(),
|
||||||
it.second.remember_password);
|
it.second.remember_password);
|
||||||
} else {
|
|
||||||
show_offline_warning_window_ = true;
|
|
||||||
offline_warning_text_ =
|
|
||||||
localization::device_offline[localization_language_index_];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SetWindowFontScale(1.0f);
|
ImGui::SetWindowFontScale(1.0f);
|
||||||
|
|||||||
@@ -498,9 +498,9 @@ void Render::OnReceiveDataBufferCb(const char* data, size_t size,
|
|||||||
const double bps =
|
const double bps =
|
||||||
(static_cast<double>(delta_bytes) * 8.0) / delta_seconds;
|
(static_cast<double>(delta_bytes) * 8.0) / delta_seconds;
|
||||||
if (bps > 0.0) {
|
if (bps > 0.0) {
|
||||||
const double capped =
|
const double capped = (std::min)(
|
||||||
(std::min)(bps, static_cast<double>(
|
bps,
|
||||||
(std::numeric_limits<uint32_t>::max)()));
|
static_cast<double>((std::numeric_limits<uint32_t>::max)()));
|
||||||
estimated_rate_bps = static_cast<uint32_t>(capped);
|
estimated_rate_bps = static_cast<uint32_t>(capped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -655,6 +655,7 @@ void Render::OnSignalStatusCb(SignalStatus status, const char* user_id,
|
|||||||
render->signal_connected_ = false;
|
render->signal_connected_ = false;
|
||||||
} else if (SignalStatus::SignalConnected == status) {
|
} else if (SignalStatus::SignalConnected == status) {
|
||||||
render->signal_connected_ = true;
|
render->signal_connected_ = true;
|
||||||
|
render->need_to_send_recent_connections_ = true;
|
||||||
LOG_INFO("[{}] connected to signal server", client_id);
|
LOG_INFO("[{}] connected to signal server", client_id);
|
||||||
} else if (SignalStatus::SignalFailed == status) {
|
} else if (SignalStatus::SignalFailed == status) {
|
||||||
render->signal_connected_ = false;
|
render->signal_connected_ = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user