Compare commits
No commits in common. "80f8f5f01ea3425eedcca090ae751dadbfe883ee" and "3bfe4dd12ca5ce7df57a2df0321d60945719634d" have entirely different histories.
80f8f5f01e
...
3bfe4dd12c
|
@ -165,23 +165,16 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||||
}else if(uMsg == WM_NCACTIVATE){
|
}else if(uMsg == WM_NCACTIVATE){
|
||||||
*result = ::DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1);
|
*result = ::DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1);
|
||||||
return true;
|
return true;
|
||||||
}else if(uMsg == WM_GETMINMAXINFO){
|
}else if(uMsg == WM_GETMINMAXINFO && QT_VERSION < QT_VERSION_CHECK(6,0,0)){
|
||||||
MINMAXINFO* minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
MINMAXINFO* minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
|
||||||
minmaxInfo->ptMaxPosition.x = 0;
|
|
||||||
minmaxInfo->ptMaxPosition.y = 0;
|
|
||||||
minmaxInfo->ptMaxSize.x = 0;
|
|
||||||
minmaxInfo->ptMaxSize.y = 0;
|
|
||||||
#else
|
|
||||||
auto pixelRatio = _helper->window->devicePixelRatio();
|
|
||||||
auto geometry = _helper->window->screen()->availableGeometry();
|
|
||||||
RECT rect;
|
RECT rect;
|
||||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
|
||||||
|
int cx = rect.right - rect.left + offsetXY.x()*2;
|
||||||
|
int cy = rect.bottom - rect.top + offsetXY.y()*2;
|
||||||
minmaxInfo->ptMaxPosition.x = rect.left - offsetXY.x();
|
minmaxInfo->ptMaxPosition.x = rect.left - offsetXY.x();
|
||||||
minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x();
|
minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x();
|
||||||
minmaxInfo->ptMaxSize.x = geometry.width()*pixelRatio + offsetXY.x() * 2;
|
minmaxInfo->ptMaxSize.x = cx;
|
||||||
minmaxInfo->ptMaxSize.y = geometry.height()*pixelRatio + offsetXY.y() * 2;
|
minmaxInfo->ptMaxSize.y = cy;
|
||||||
#endif
|
|
||||||
}else if(uMsg == WM_NCRBUTTONDOWN){
|
}else if(uMsg == WM_NCRBUTTONDOWN){
|
||||||
if (wParam == HTCAPTION) {
|
if (wParam == HTCAPTION) {
|
||||||
_helper->showSystemMenu(QCursor::pos());
|
_helper->showSystemMenu(QCursor::pos());
|
||||||
|
|
Loading…
Reference in New Issue