Skip to content

Commit

Permalink
fix: 修复模拟独占全屏错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue committed Jun 5, 2024
1 parent 238f66e commit 5f8d04b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Magpie.Core/ExclModeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ wil::unique_mutex_nothrow ExclModeHelper::EnterExclMode() noexcept {
return exclModeMutex;
}

if (!wil::event_is_signaled(exclModeMutex.get())) {
if (!wil::handle_wait(exclModeMutex.get(), 0)) {
Logger::Get().Error("获取 __DDrawExclMode__ 失败");
exclModeMutex.reset();
return exclModeMutex;
Expand Down
6 changes: 4 additions & 2 deletions src/Magpie.Core/ScalingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,10 @@ LRESULT ScalingWindow::_MessageHandler(UINT msg, WPARAM wParam, LPARAM lParam) n
}
case WM_DESTROY:
{
_exclModeMutex.ReleaseMutex();
_exclModeMutex.reset();
if (_exclModeMutex) {
_exclModeMutex.ReleaseMutex();
_exclModeMutex.reset();
}

_hwndDDF.reset();
_isDDFWindowShown = false;
Expand Down

0 comments on commit 5f8d04b

Please sign in to comment.