mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
feat: Desktop Duplication 允许小的弹窗而不退出全屏
This commit is contained in:
parent
de60b4e149
commit
47ba53d036
9 changed files with 67 additions and 16 deletions
|
|
@ -71,6 +71,8 @@ bool GraphicsCaptureFrameSource::Initialize() {
|
|||
if (!_CaptureFromMonitor(interop)) {
|
||||
SPDLOG_LOGGER_ERROR(logger, "屏幕捕获失败");
|
||||
return false;
|
||||
} else {
|
||||
_canCapturePopup = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -174,9 +176,8 @@ bool GraphicsCaptureFrameSource::_CaptureFromWindow(winrt::impl::com_ref<IGraphi
|
|||
|
||||
// 包含边框的窗口尺寸
|
||||
RECT srcRect{};
|
||||
HRESULT hr = DwmGetWindowAttribute(hwndSrc, DWMWA_EXTENDED_FRAME_BOUNDS, &srcRect, sizeof(srcRect));
|
||||
if (FAILED(hr)) {
|
||||
SPDLOG_LOGGER_ERROR(logger, MakeComErrorMsg("DwmGetWindowAttribute 失败", hr));
|
||||
if (!Utils::GetWindowFrameRect(hwndSrc, srcRect)) {
|
||||
SPDLOG_LOGGER_ERROR(logger, "GetWindowFrameRect 失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -198,7 +199,7 @@ bool GraphicsCaptureFrameSource::_CaptureFromWindow(winrt::impl::com_ref<IGraphi
|
|||
};
|
||||
|
||||
try {
|
||||
hr = interop->CreateForWindow(
|
||||
HRESULT hr = interop->CreateForWindow(
|
||||
hwndSrc,
|
||||
winrt::guid_of<ABI::Windows::Graphics::Capture::IGraphicsCaptureItem>(),
|
||||
winrt::put_abi(_captureItem)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue