Skip to content

Commit

Permalink
修正Windows 11 build 22621版本后触屏设备任务栏窗口位置不正确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongyang219 committed Mar 20, 2023
1 parent b4ecf1c commit 809ebc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TrafficMonitor/TaskBarDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ bool CTaskBarDlg::AdjustWindowPos()
m_rect.MoveToX(m_left_space);
}
}
m_rect.MoveToY((m_rcTaskbar.Height() - m_rect.Height()) / 2 + DPI(theApp.m_taskbar_data.window_offset_top));
//注:这里加上(m_rcTaskbar.Height() - m_rcBar.Height())用于修正Windows11 build 22621版本后触屏设备任务栏窗口位置不正确的问题。
//在这种情况下m_rcTaskbar的高度要大于m_rcBar的高度,正常情况下,它们的高度相同
m_rect.MoveToY((m_rcBar.Height() - m_rect.Height()) / 2 + (m_rcTaskbar.Height() - m_rcBar.Height()) + DPI(theApp.m_taskbar_data.window_offset_top));
if (theApp.m_taskbar_data.horizontal_arrange && theApp.m_win_version.IsWindows7())
m_rect.MoveToY(m_rect.top + DPI(1));
MoveWindow(m_rect);
Expand Down

0 comments on commit 809ebc7

Please sign in to comment.