mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
fix: 优化 3D 游戏模式
This commit is contained in:
parent
6dbb9f83ea
commit
475c32a2ef
3 changed files with 15 additions and 4 deletions
|
|
@ -110,7 +110,7 @@ static std::optional<LRESULT> HostWndProc(HWND hWnd, UINT message, WPARAM wParam
|
|||
HWND hwndSrc = App::Get().GetHwndSrc();
|
||||
HWND hwndForground = GetForegroundWindow();
|
||||
if (hwndForground != hwndSrc) {
|
||||
if (!SetForegroundWindow(hwndSrc)) {
|
||||
if (!Utils::SetForegroundWindow(hwndSrc)) {
|
||||
// 设置前台窗口失败,可能是因为前台窗口是开始菜单
|
||||
if (Utils::IsStartMenu(hwndForground)) {
|
||||
// 限制触发频率
|
||||
|
|
@ -192,6 +192,14 @@ void CursorManager::OnBeginFrame() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (App::Get().GetConfig().Is3DMode()) {
|
||||
HWND hwndFore = GetForegroundWindow();
|
||||
if (hwndFore != App::Get().GetHwndHost() && hwndFore != App::Get().GetHwndSrc()) {
|
||||
_curCursor = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CURSORINFO ci{};
|
||||
ci.cbSize = sizeof(ci);
|
||||
if (!::GetCursorInfo(&ci)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue