forked from github_mirror/framelesshelper
Work-around Win7 bug.
Re-apply it: tested on Windows 7 and 8.1 in my VMs. The bug is there indeed. Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
5468ce8411
commit
01bde69ae6
|
@ -489,8 +489,20 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
|
||||||
const RECT rcWorkArea = monitorInfo.rcWork;
|
const RECT rcWorkArea = monitorInfo.rcWork;
|
||||||
const RECT rcMonitorArea = monitorInfo.rcMonitor;
|
const RECT rcMonitorArea = monitorInfo.rcMonitor;
|
||||||
auto &mmi = *reinterpret_cast<LPMINMAXINFO>(msg->lParam);
|
auto &mmi = *reinterpret_cast<LPMINMAXINFO>(msg->lParam);
|
||||||
mmi.ptMaxPosition.x = qAbs(rcWorkArea.left - rcMonitorArea.left);
|
if (QOperatingSystemVersion::current() <
|
||||||
mmi.ptMaxPosition.y = qAbs(rcWorkArea.top - rcMonitorArea.top);
|
QOperatingSystemVersion::Windows8) {
|
||||||
|
// Buggy on Windows 7:
|
||||||
|
// The origin of coordinates is the top left edge of the
|
||||||
|
// monitor's work area. Why? It should be the top left edge of
|
||||||
|
// the monitor's area.
|
||||||
|
mmi.ptMaxPosition.x = rcMonitorArea.left;
|
||||||
|
mmi.ptMaxPosition.y = rcMonitorArea.top;
|
||||||
|
} else {
|
||||||
|
// Works fine on Windows 8/8.1/10
|
||||||
|
mmi.ptMaxPosition.x =
|
||||||
|
qAbs(rcWorkArea.left - rcMonitorArea.left);
|
||||||
|
mmi.ptMaxPosition.y = qAbs(rcWorkArea.top - rcMonitorArea.top);
|
||||||
|
}
|
||||||
mmi.ptMaxSize.x = qAbs(rcWorkArea.right - rcWorkArea.left);
|
mmi.ptMaxSize.x = qAbs(rcWorkArea.right - rcWorkArea.left);
|
||||||
mmi.ptMaxSize.y = qAbs(rcWorkArea.bottom - rcWorkArea.top);
|
mmi.ptMaxSize.y = qAbs(rcWorkArea.bottom - rcWorkArea.top);
|
||||||
mmi.ptMaxTrackSize.x = mmi.ptMaxSize.x;
|
mmi.ptMaxTrackSize.x = mmi.ptMaxSize.x;
|
||||||
|
|
Loading…
Reference in New Issue