diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 42a69cfbcd..19db4811df 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -256,18 +256,34 @@ KDecorationDefines::Position AuroraeClient::mousePosition(const QPoint &point) c borders(borderLeft, borderRight, borderTop, borderBottom); int paddingLeft, paddingTop, paddingRight, paddingBottom; padding(paddingLeft, paddingRight, paddingTop, paddingBottom); + const bool maximized = maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows(); + int titleEdgeLeft, titleEdgeRight, titleEdgeTop, titleEdgeBottom; + AuroraeFactory::instance()->theme()->titleEdges(titleEdgeLeft, titleEdgeTop, titleEdgeRight, titleEdgeBottom, maximized); + switch (AuroraeFactory::instance()->theme()->decorationPosition()) { + case DecorationTop: + borderTop = titleEdgeTop; + break; + case DecorationLeft: + borderLeft = titleEdgeLeft; + break; + case DecorationRight: + borderRight = titleEdgeRight; + break; + case DecorationBottom: + borderBottom = titleEdgeBottom; + break; + default: + break; // nothing + } if (point.x() >= (m_view->width() - borderRight - paddingRight)) { pos |= PositionRight; } else if (point.x() <= borderLeft + paddingLeft) { pos |= PositionLeft; } - const bool maximized = maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows(); - int titleEdgeLeft, titleEdgeRight, titleEdgeTop, titleEdgeBottom; - AuroraeFactory::instance()->theme()->titleEdges(titleEdgeLeft, titleEdgeTop, titleEdgeRight, titleEdgeBottom, maximized); if (point.y() >= m_view->height() - borderBottom - paddingBottom) { pos |= PositionBottom; - } else if (point.y() <= titleEdgeTop + paddingTop ) { + } else if (point.y() <= borderTop + paddingTop ) { pos |= PositionTop; } diff --git a/clients/aurorae/src/lib/auroraetheme.cpp b/clients/aurorae/src/lib/auroraetheme.cpp index 26b0241652..fd7c8ca823 100644 --- a/clients/aurorae/src/lib/auroraetheme.cpp +++ b/clients/aurorae/src/lib/auroraetheme.cpp @@ -450,4 +450,9 @@ qreal AuroraeTheme::buttonSizeFactor() const } } +DecorationPosition AuroraeTheme::decorationPosition() const +{ + return (DecorationPosition)d->themeConfig.decorationPosition(); +} + } // namespace diff --git a/clients/aurorae/src/lib/auroraetheme.h b/clients/aurorae/src/lib/auroraetheme.h index ab33078e99..7169039368 100644 --- a/clients/aurorae/src/lib/auroraetheme.h +++ b/clients/aurorae/src/lib/auroraetheme.h @@ -119,6 +119,8 @@ public: void setButtonSize(KDecorationDefines::BorderSize size); qreal buttonSizeFactor() const; + DecorationPosition decorationPosition() const; + // TODO: move to namespace static QLatin1String mapButtonToName(AuroraeButtonType type); static char mapButtonToChar(AuroraeButtonType type);