From 2b324f636bfaf828f11a0464bcc910858c6e76a1 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Thu, 12 Feb 2026 22:49:54 +0800 Subject: [PATCH 1/6] [fix] fix macOS system certificate loading failure --- submodules/minirtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/minirtc b/submodules/minirtc index 28ca08b..5b11dc7 160000 --- a/submodules/minirtc +++ b/submodules/minirtc @@ -1 +1 @@ -Subproject commit 28ca08bce9c67712a296044a85d147c4a0d1b9bd +Subproject commit 5b11dc7c9ac2f667c0660bd98357fa039401c8f2 From a91e23abf67d84ef4659e8f31b12d29be87e3708 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 13 Feb 2026 01:12:21 +0800 Subject: [PATCH 2/6] [fix] fix raw pointer issues when closing connections --- src/gui/render.cpp | 8 ++++---- src/gui/render.h | 2 +- src/gui/windows/stream_window.cpp | 25 ++++++++++--------------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/gui/render.cpp b/src/gui/render.cpp index 77075ad..d9cdc72 100644 --- a/src/gui/render.cpp +++ b/src/gui/render.cpp @@ -893,7 +893,7 @@ void Render::UpdateInteractions() { mouse_controller_is_started_ = false; } - if (start_keyboard_capturer_ && foucs_on_stream_window_) { + if (start_keyboard_capturer_ && focus_on_stream_window_) { if (!keyboard_capturer_is_started_) { StartKeyboardCapturer(); keyboard_capturer_is_started_ = true; @@ -2176,7 +2176,7 @@ void Render::ProcessSdlEvent(const SDL_Event& event) { case SDL_EVENT_WINDOW_FOCUS_GAINED: if (stream_window_ && SDL_GetWindowID(stream_window_) == event.window.windowID) { - foucs_on_stream_window_ = true; + focus_on_stream_window_ = true; } else if (main_window_ && SDL_GetWindowID(main_window_) == event.window.windowID) { foucs_on_main_window_ = true; @@ -2186,7 +2186,7 @@ void Render::ProcessSdlEvent(const SDL_Event& event) { case SDL_EVENT_WINDOW_FOCUS_LOST: if (stream_window_ && SDL_GetWindowID(stream_window_) == event.window.windowID) { - foucs_on_stream_window_ = false; + focus_on_stream_window_ = false; } else if (main_window_ && SDL_GetWindowID(main_window_) == event.window.windowID) { foucs_on_main_window_ = false; @@ -2200,7 +2200,7 @@ void Render::ProcessSdlEvent(const SDL_Event& event) { case SDL_EVENT_MOUSE_BUTTON_DOWN: case SDL_EVENT_MOUSE_BUTTON_UP: case SDL_EVENT_MOUSE_WHEEL: - if (foucs_on_stream_window_) { + if (focus_on_stream_window_) { ProcessMouseEvent(event); } break; diff --git a/src/gui/render.h b/src/gui/render.h index 2736d12..2f59a5e 100644 --- a/src/gui/render.h +++ b/src/gui/render.h @@ -434,7 +434,7 @@ class Render { bool show_cursor_ = false; bool keyboard_capturer_is_started_ = false; bool foucs_on_main_window_ = false; - bool foucs_on_stream_window_ = false; + bool focus_on_stream_window_ = false; bool main_window_minimized_ = false; uint32_t last_main_minimize_request_tick_ = 0; uint32_t last_stream_minimize_request_tick_ = 0; diff --git a/src/gui/windows/stream_window.cpp b/src/gui/windows/stream_window.cpp index b6f3a4a..ffa58cb 100644 --- a/src/gui/windows/stream_window.cpp +++ b/src/gui/windows/stream_window.cpp @@ -138,7 +138,7 @@ int Render::StreamWindow() { UpdateRenderRect(); ControlWindow(props); - + // Show file transfer window if needed FileTransferWindow(props); @@ -151,12 +151,12 @@ int Render::StreamWindow() { // std::unique_lock unique_lock(client_properties_mutex_); auto erase_it = client_properties_.find(remote_id_to_erase); if (erase_it != client_properties_.end()) { - erase_it = client_properties_.erase(erase_it); - if (client_properties_.empty()) { - SDL_Event event; - event.type = SDL_EVENT_QUIT; - SDL_PushEvent(&event); - } + // Ensure we flush pending STREAM_REFRESH_EVENT events and + // clean up peer resources before erasing the entry, otherwise + // SDL events may still hold raw pointers to freed + // SubStreamWindowProperties (including video_frame_mutex_), + // leading to std::system_error when locking. + CloseTab(erase_it); } } // lock.lock(); @@ -236,10 +236,10 @@ int Render::StreamWindow() { UpdateRenderRect(); ControlWindow(props); - + // Show file transfer window if needed FileTransferWindow(props); - + ImGui::End(); if (!props->peer_) { @@ -251,12 +251,7 @@ int Render::StreamWindow() { // std::unique_lock unique_lock(client_properties_mutex_); auto erase_it = client_properties_.find(remote_id_to_erase); if (erase_it != client_properties_.end()) { - client_properties_.erase(erase_it); - if (client_properties_.empty()) { - SDL_Event event; - event.type = SDL_EVENT_QUIT; - SDL_PushEvent(&event); - } + CloseTab(erase_it); } } // lock.lock(); From 547532b28c2c61182adebb1dcc7a733793ae4313 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 13 Feb 2026 01:26:10 +0800 Subject: [PATCH 3/6] [fix] fix server window scaling issues on high-DPI displays --- src/gui/render.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gui/render.cpp b/src/gui/render.cpp index d9cdc72..2a5a7fc 100644 --- a/src/gui/render.cpp +++ b/src/gui/render.cpp @@ -1393,23 +1393,19 @@ int Render::DrawServerWindow() { LOG_ERROR("Server context is null"); return -1; } - - if (server_window_) { - int w = 0; - int h = 0; - SDL_GetWindowSize(server_window_, &w, &h); - if (w > 0 && h > 0) { - server_window_width_ = (float)w; - server_window_height_ = (float)h; - } - } - ImGui::SetCurrentContext(server_ctx_); ImGui_ImplSDLRenderer3_NewFrame(); ImGui_ImplSDL3_NewFrame(); ImGui::NewFrame(); + + ImGuiIO& io = ImGui::GetIO(); + server_window_width_ = io.DisplaySize.x; + server_window_height_ = io.DisplaySize.y; + ServerWindow(); ImGui::Render(); + SDL_SetRenderScale(server_renderer_, io.DisplayFramebufferScale.x, + io.DisplayFramebufferScale.y); SDL_SetRenderDrawColor(server_renderer_, 255, 255, 255, 255); SDL_RenderClear(server_renderer_); ImGui_ImplSDLRenderer3_RenderDrawData(ImGui::GetDrawData(), server_renderer_); From bf1c0f796d1ef61d28bc938bfb07f188593c4f0c Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 13 Feb 2026 01:56:49 +0800 Subject: [PATCH 4/6] [fix] fix Linux system certificate loading failure --- submodules/minirtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/minirtc b/submodules/minirtc index 5b11dc7..8853e0f 160000 --- a/submodules/minirtc +++ b/submodules/minirtc @@ -1 +1 @@ -Subproject commit 5b11dc7c9ac2f667c0660bd98357fa039401c8f2 +Subproject commit 8853e0f0fbd1db9c68f1b3d6b1f345af70dae3f0 From e35365d162156b79bae28db43c130da727b85320 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 13 Feb 2026 02:29:52 +0800 Subject: [PATCH 5/6] [feat] disable and style minimize_to_tray checkbox for non-Windows platforms --- src/gui/assets/localization/localization.h | 3 +-- src/gui/windows/main_settings_window.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/assets/localization/localization.h b/src/gui/assets/localization/localization.h index ed04a78..0dec845 100644 --- a/src/gui/assets/localization/localization.h +++ b/src/gui/assets/localization/localization.h @@ -205,11 +205,10 @@ static std::vector browse = { reinterpret_cast(u8"浏览"), "Browse"}; static std::vector default_desktop = { reinterpret_cast(u8"桌面"), "Desktop"}; - -#if _WIN32 static std::vector minimize_to_tray = { reinterpret_cast(u8"退出时最小化到系统托盘:"), "Minimize to system tray when exit:"}; +#if _WIN32 static std::vector exit_program = {L"退出", L"Exit"}; #endif #ifdef __APPLE__ diff --git a/src/gui/windows/main_settings_window.cpp b/src/gui/windows/main_settings_window.cpp index 3b8f203..c825659 100644 --- a/src/gui/windows/main_settings_window.cpp +++ b/src/gui/windows/main_settings_window.cpp @@ -331,10 +331,14 @@ int Render::SettingWindow() { ImGui::EndTooltip(); } } -#if _WIN32 + ImGui::Separator(); { +#ifndef _WIN32 + ImGui::BeginDisabled(); + ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.5f, 0.5f, 0.5f, 1.0f)); +#endif settings_items_offset += settings_items_padding; ImGui::SetCursorPosY(settings_items_offset); ImGui::AlignTextToFramePadding(); @@ -350,8 +354,11 @@ int Render::SettingWindow() { ImGui::Checkbox("##enable_minimize_to_tray_", &enable_minimize_to_tray_); - } +#ifndef _WIN32 + ImGui::PopStyleColor(); + ImGui::EndDisabled(); #endif + } ImGui::Separator(); From 42506b8c1dc4becc05d468bd77890e0d46bce2de Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 13 Feb 2026 02:31:58 +0800 Subject: [PATCH 6/6] [ci] combine Linux amd64 and arm64 builds into a single job using matrix --- .github/workflows/build.yml | 75 +++++++------------------------------ 1 file changed, 14 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6365e0c..13458ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,76 +15,28 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: - # Linux amd64 - build-linux-amd64: - name: Build on Ubuntu 22.04 amd64 - runs-on: ubuntu-22.04 - container: - image: crossdesk/ubuntu20.04:latest - options: --user root - steps: - - name: Extract version number - id: version - run: | - VERSION="${GITHUB_REF##*/}" - VERSION_NUM="${VERSION#v}" - echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_ENV - - - name: Set legal Debian version - shell: bash - id: set_deb_version - run: | - SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7) - BUILD_DATE=$(TZ=Asia/Shanghai date +%Y%m%d) - if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then - LEGAL_VERSION="v0.0.0-${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}" - else - LEGAL_VERSION="v${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}" - fi - echo "LEGAL_VERSION=${LEGAL_VERSION}" >> $GITHUB_ENV - echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV - - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Build CrossDesk - env: - CUDA_PATH: /usr/local/cuda - XMAKE_GLOBALDIR: /data - run: | - ls -la $XMAKE_GLOBALDIR - xmake f --CROSSDESK_VERSION=${LEGAL_VERSION} --USE_CUDA=true --root -y - xmake b -vy --root crossdesk - - - name: Package - run: | - chmod +x ./scripts/linux/pkg_amd64.sh - ./scripts/linux/pkg_amd64.sh ${LEGAL_VERSION} - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: crossdesk-linux-amd64-${{ env.LEGAL_VERSION }} - path: ${{ github.workspace }}/crossdesk-linux-amd64-${{ env.LEGAL_VERSION }}.deb - - # Linux arm64 - build-linux-arm64: - name: Build on Ubuntu 22.04 arm64 - runs-on: ubuntu-22.04-arm + build-linux: + name: Build Linux (${{ matrix.arch }}) + runs-on: ${{ matrix.runner }} strategy: matrix: include: + - arch: amd64 + runner: ubuntu-22.04 + image: crossdesk/ubuntu20.04:latest + package_script: ./scripts/linux/pkg_amd64.sh + - arch: arm64 + runner: ubuntu-22.04-arm image: crossdesk/ubuntu20.04-arm64v8:latest package_script: ./scripts/linux/pkg_arm64.sh + container: image: ${{ matrix.image }} options: --user root + steps: - name: Extract version number - id: version run: | VERSION="${GITHUB_REF##*/}" VERSION_NUM="${VERSION#v}" @@ -92,15 +44,16 @@ jobs: - name: Set legal Debian version shell: bash - id: set_deb_version run: | SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7) BUILD_DATE=$(TZ=Asia/Shanghai date +%Y%m%d) + if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then LEGAL_VERSION="v0.0.0-${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}" else LEGAL_VERSION="v${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}" fi + echo "LEGAL_VERSION=${LEGAL_VERSION}" >> $GITHUB_ENV echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV @@ -313,7 +266,7 @@ jobs: name: Publish Release if: startsWith(github.ref, 'refs/tags/v') needs: - [build-linux-amd64, build-linux-arm64, build-macos, build-windows-x64] + [build-linux, build-macos, build-windows-x64] runs-on: ubuntu-latest steps: