From 43db02132609d95c7e477aa95259d5dfb38d63e5 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 31 Oct 2025 17:31:50 +0800 Subject: [PATCH] [feat] use CROSSDESK_DEBUG compile-time variable to control config file path --- src/app/main.cpp | 2 +- src/gui/panels/remote_peer_panel.cpp | 4 ++++ src/gui/render_callback.cpp | 2 +- src/path_manager/path_manager.cpp | 4 ++++ submodules/minirtc | 2 +- xmake.lua | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index c490372..b583526 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -1,5 +1,5 @@ #ifdef _WIN32 -#ifdef DESK_PORT_DEBUG +#ifdef CROSSDESK_DEBUG #pragma comment(linker, "/subsystem:\"console\"") #else #pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"") diff --git a/src/gui/panels/remote_peer_panel.cpp b/src/gui/panels/remote_peer_panel.cpp index 2bbbc99..a51d949 100644 --- a/src/gui/panels/remote_peer_panel.cpp +++ b/src/gui/panels/remote_peer_panel.cpp @@ -145,6 +145,10 @@ int Render::ConnectTo(const std::string& remote_id, const char* password, memcpy(&props->params_, ¶ms_, sizeof(Params)); props->params_.user_id = props->local_id_.c_str(); props->peer_ = CreatePeer(&props->params_); + + for (auto& display_info : display_info_list_) { + AddVideoStream(peer_, display_info.name.c_str()); + } AddAudioStream(props->peer_, props->audio_label_.c_str()); AddDataStream(props->peer_, props->data_label_.c_str()); diff --git a/src/gui/render_callback.cpp b/src/gui/render_callback.cpp index 4622e38..a03b13e 100644 --- a/src/gui/render_callback.cpp +++ b/src/gui/render_callback.cpp @@ -6,7 +6,7 @@ #define NV12_BUFFER_SIZE 1280 * 720 * 3 / 2 -#ifdef DESK_PORT_DEBUG +#ifdef CROSSDESK_DEBUG #else #define MOUSE_CONTROL 1 #endif diff --git a/src/path_manager/path_manager.cpp b/src/path_manager/path_manager.cpp index 3b180c3..99f469c 100644 --- a/src/path_manager/path_manager.cpp +++ b/src/path_manager/path_manager.cpp @@ -18,7 +18,11 @@ std::filesystem::path PathManager::GetConfigPath() { std::filesystem::path PathManager::GetCachePath() { #ifdef _WIN32 +#ifdef CROSSDESK_DEBUG + return "cache"; +#else return GetKnownFolder(FOLDERID_LocalAppData) / app_name_ / "cache"; +#endif #elif __APPLE__ return GetEnvOrDefault("XDG_CACHE_HOME", GetHome() + "/.cache") / app_name_; #else diff --git a/submodules/minirtc b/submodules/minirtc index 40eaf93..1f999db 160000 --- a/submodules/minirtc +++ b/submodules/minirtc @@ -1 +1 @@ -Subproject commit 40eaf93b422c203ed61418baa71adb35783d8fc3 +Subproject commit 1f999dbe1f5d3f4300c1cf7c104d3190e8be8cfc diff --git a/xmake.lua b/xmake.lua index 1f02c35..85ac3e9 100644 --- a/xmake.lua +++ b/xmake.lua @@ -16,7 +16,7 @@ set_encodings("utf-8") add_defines("UNICODE") if is_mode("debug") then - add_defines("DESK_PORT_DEBUG") + add_defines("CROSSDESK_DEBUG") end add_requires("spdlog 1.14.1", {system = false})