mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
feat: 实现多屏幕支持
This commit is contained in:
parent
2954d712be
commit
d68a2e0622
12 changed files with 110 additions and 35 deletions
|
|
@ -156,10 +156,6 @@ bool DesktopDuplicationFrameSource::Initialize() {
|
|||
return true;
|
||||
}
|
||||
|
||||
inline bool CheckOverlap(const RECT& r1, const RECT& r2) {
|
||||
return r1.right > r2.left && r1.bottom > r2.top && r1.left < r2.right && r1.top < r2.bottom;
|
||||
}
|
||||
|
||||
FrameSourceBase::UpdateState DesktopDuplicationFrameSource::Update() {
|
||||
DXGI_OUTDUPL_FRAME_INFO info;
|
||||
|
||||
|
|
@ -199,7 +195,7 @@ FrameSourceBase::UpdateState DesktopDuplicationFrameSource::Update() {
|
|||
UINT nRect = bufSize / sizeof(DXGI_OUTDUPL_MOVE_RECT);
|
||||
for (UINT i = 0; i < nRect; ++i) {
|
||||
const DXGI_OUTDUPL_MOVE_RECT& rect = ((DXGI_OUTDUPL_MOVE_RECT*)_dupMetaData.data())[i];
|
||||
if (CheckOverlap(_srcClientInMonitor, rect.DestinationRect)) {
|
||||
if (Utils::CheckOverlap(_srcClientInMonitor, rect.DestinationRect)) {
|
||||
noUpdate = false;
|
||||
break;
|
||||
}
|
||||
|
|
@ -218,7 +214,7 @@ FrameSourceBase::UpdateState DesktopDuplicationFrameSource::Update() {
|
|||
nRect = bufSize / sizeof(RECT);
|
||||
for (UINT i = 0; i < nRect; ++i) {
|
||||
const RECT& rect = ((RECT*)_dupMetaData.data())[i];
|
||||
if (CheckOverlap(_srcClientInMonitor, rect)) {
|
||||
if (Utils::CheckOverlap(_srcClientInMonitor, rect)) {
|
||||
noUpdate = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue