mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
1.Fix texture update crash; 2.Do not show control window when in server mode
This commit is contained in:
@@ -372,10 +372,10 @@ int Render::Run() {
|
||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar);
|
||||
ImGui::PopStyleVar();
|
||||
ImGui::PopStyleColor();
|
||||
if (!streaming_) {
|
||||
MainWindow();
|
||||
} else {
|
||||
if (streaming_ && is_client_mode_) {
|
||||
ControlWindow();
|
||||
} else {
|
||||
MainWindow();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
@@ -438,7 +438,7 @@ int Render::Run() {
|
||||
}
|
||||
} else if (event.type == REFRESH_EVENT) {
|
||||
if (stream_texture_)
|
||||
SDL_UpdateTexture(stream_texture_, NULL, dst_buffer_, 1280 * 720 * 3);
|
||||
SDL_UpdateTexture(stream_texture_, NULL, dst_buffer_, 1280);
|
||||
} else {
|
||||
if (connection_established_) {
|
||||
ProcessMouseKeyEven(event);
|
||||
|
||||
@@ -180,13 +180,15 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, void *user_data) {
|
||||
render->connection_status_str_ = "Connected";
|
||||
render->connection_established_ = true;
|
||||
render->streaming_ = true;
|
||||
|
||||
if (!render->is_client_mode_) {
|
||||
render->start_screen_capture_ = true;
|
||||
render->start_mouse_control_ = true;
|
||||
} else {
|
||||
SDL_SetWindowSize(render->main_window_, render->stream_window_width_,
|
||||
render->stream_window_height_);
|
||||
SDL_SetWindowPosition(render->main_window_, SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED);
|
||||
if (!render->is_client_mode_) {
|
||||
render->start_screen_capture_ = true;
|
||||
render->start_mouse_control_ = true;
|
||||
}
|
||||
} else if (ConnectionStatus::Disconnected == status) {
|
||||
render->connection_status_str_ = "Disconnected";
|
||||
|
||||
Reference in New Issue
Block a user