[fix] fix startup failure caused by wgc_plugin working directory change

This commit is contained in:
dijunkun
2026-04-14 01:53:20 +08:00
parent c1394db285
commit 3e95a7ba29
2 changed files with 18 additions and 1 deletions
@@ -1,9 +1,26 @@
#include <mutex>
#include "path_manager.h"
#include "rd_log.h"
#include "screen_capturer_wgc.h"
#include "wgc_plugin_api.h"
namespace {
void InitializePluginLogger() {
static std::once_flag once;
std::call_once(once, []() {
crossdesk::PathManager path_manager("CrossDesk");
crossdesk::InitLogger(path_manager.GetLogPath().string());
});
}
} // namespace
extern "C" {
crossdesk::ScreenCapturer* CrossDeskCreateWgcCapturer() {
InitializePluginLogger();
return new crossdesk::ScreenCapturerWgc();
}