mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-04-27 22:03:05 +08:00
[fix] fix startup failure caused by wgc_plugin working directory change
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ function setup_targets()
|
||||
target("wgc_plugin")
|
||||
set_kind("shared")
|
||||
add_packages("libyuv")
|
||||
add_deps("rd_log")
|
||||
add_deps("rd_log", "path_manager")
|
||||
add_defines("CROSSDESK_WGC_PLUGIN_BUILD=1")
|
||||
add_links("windowsapp")
|
||||
add_files("src/screen_capturer/windows/screen_capturer_wgc.cpp",
|
||||
|
||||
Reference in New Issue
Block a user