diff --git a/framelesshelper.cpp b/framelesshelper.cpp index 28ca2bf..15ca998 100644 --- a/framelesshelper.cpp +++ b/framelesshelper.cpp @@ -522,9 +522,17 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event) { &isResizePermitted](const QPointF &globalPoint, const QPointF &point, QObject *const window) -> bool { if (window) { - return ((point.y() <= m_titleBarHeight) && - isInDraggableAreas(point, window) && - isInDraggableObjects(globalPoint, window) && + const bool customDragAreas = !getDraggableAreas(window).isEmpty(); +#if defined(QT_WIDGETS_LIB) || defined(QT_QUICK_LIB) + const bool customDragObjects = + !getDraggableObjects(window).isEmpty(); +#else + const bool customDragObjects = false; +#endif + const bool customDrag = customDragAreas || customDragObjects; + return ((customDrag ? (isInDraggableAreas(point, window) && + isInDraggableObjects(globalPoint, window)) + : (point.y() <= m_titleBarHeight)) && isResizePermitted(globalPoint, point, window) && getTitleBarEnabled(window)); } diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index 4ddf0d4..2bf3283 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -688,18 +688,14 @@ qreal GetPreferedNumber(const qreal num) { } else { if (in < (m_defaultDotsPerInch * 1.5)) { return m_defaultDotsPerInch; - } else if (in == (m_defaultDotsPerInch * 1.5)) { - return m_defaultDotsPerInch * 1.5; } else if (in < (m_defaultDotsPerInch * 2.5)) { return m_defaultDotsPerInch * 2; - } else if (in == (m_defaultDotsPerInch * 2.5)) { - return m_defaultDotsPerInch * 2.5; } else if (in < (m_defaultDotsPerInch * 3.5)) { return m_defaultDotsPerInch * 3; - } else if (in == (m_defaultDotsPerInch * 3.5)) { - return m_defaultDotsPerInch * 3.5; } else if (in < (m_defaultDotsPerInch * 4.5)) { return m_defaultDotsPerInch * 4; + } else if (in < (m_defaultDotsPerInch * 5.5)) { + return m_defaultDotsPerInch * 5; } else { qWarning().noquote() << "DPI too large:" << static_cast(in);