mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
feat: 实现托盘图标功能
This commit is contained in:
parent
4c89273585
commit
a75d54419a
5 changed files with 34 additions and 33 deletions
|
|
@ -103,7 +103,7 @@ bool GraphicsCaptureFrameSource::Initialize() {
|
|||
// 开始捕获
|
||||
_captureSession = _captureFramePool.CreateCaptureSession(captureItem);
|
||||
|
||||
// 隐藏光标
|
||||
// 不捕获光标
|
||||
if (winrt::ApiInformation::IsPropertyPresent(
|
||||
L"Windows.Graphics.Capture.GraphicsCaptureSession",
|
||||
L"IsCursorCaptureEnabled"
|
||||
|
|
@ -119,7 +119,7 @@ bool GraphicsCaptureFrameSource::Initialize() {
|
|||
L"Windows.Graphics.Capture.GraphicsCaptureSession",
|
||||
L"IsBorderRequired"
|
||||
)) {
|
||||
// 从 win11 开始提供
|
||||
// 从 Win11 开始提供
|
||||
// 先请求权限
|
||||
auto status = winrt::GraphicsCaptureAccess::RequestAccessAsync(winrt::GraphicsCaptureAccessKind::Borderless).get();
|
||||
if (status == decltype(status)::Allowed) {
|
||||
|
|
@ -127,7 +127,6 @@ bool GraphicsCaptureFrameSource::Initialize() {
|
|||
} else {
|
||||
SPDLOG_LOGGER_INFO(logger, "IsCursorCaptureEnabled 失败");
|
||||
}
|
||||
|
||||
} else {
|
||||
SPDLOG_LOGGER_INFO(logger, "当前系统无 IsBorderRequired API");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue