mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
refactor: 新增 hwndSrcClient 表示代表客户区域的窗口(如果有的话)
This commit is contained in:
parent
ee5f33a8bf
commit
215114309e
9 changed files with 86 additions and 70 deletions
|
|
@ -6,11 +6,11 @@
|
|||
extern std::shared_ptr<spdlog::logger> logger;
|
||||
|
||||
bool GDIFrameSource::Initialize() {
|
||||
_hwndSrc = App::GetInstance().GetHwndSrc();
|
||||
_hwndSrcClient = App::GetInstance().GetHwndSrcClient();
|
||||
const RECT& srcClientRect = App::GetInstance().GetSrcClientRect();
|
||||
|
||||
float dpiScale = -1;
|
||||
if (!_GetWindowDpiScale(_hwndSrc, dpiScale)) {
|
||||
if (!_GetWindowDpiScale(_hwndSrcClient, dpiScale)) {
|
||||
SPDLOG_LOGGER_ERROR(logger, "_GetWindowDpiScale 失败");
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ bool GDIFrameSource::Update() {
|
|||
return false;
|
||||
}
|
||||
|
||||
HDC hdcSrcClient = GetDCEx(_hwndSrc, NULL, DCX_LOCKWINDOWUPDATE);
|
||||
HDC hdcSrcClient = GetDCEx(_hwndSrcClient, NULL, DCX_LOCKWINDOWUPDATE);
|
||||
if (!hdcSrcClient) {
|
||||
SPDLOG_LOGGER_ERROR(logger, MakeWin32ErrorMsg("GetDC 失败"));
|
||||
_dxgiSurface->ReleaseDC(nullptr);
|
||||
|
|
@ -76,7 +76,7 @@ bool GDIFrameSource::Update() {
|
|||
SPDLOG_LOGGER_ERROR(logger, MakeWin32ErrorMsg("BitBlt 失败"));
|
||||
}
|
||||
|
||||
ReleaseDC(_hwndSrc, hdcSrcClient);
|
||||
ReleaseDC(_hwndSrcClient, hdcSrcClient);
|
||||
_dxgiSurface->ReleaseDC(nullptr);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue