diff --git a/kcm/src/declarative/qmlscreen.h b/kcm/src/declarative/qmlscreen.h --- a/kcm/src/declarative/qmlscreen.h +++ b/kcm/src/declarative/qmlscreen.h @@ -104,6 +104,7 @@ KScreen::ConfigPtr m_config; QHash m_outputMap; + QVector m_manuallyMovedOutputs; int m_connectedOutputsCount = 0; int m_enabledOutputsCount = 0; float m_outputScale = 1.0 / 8.0; diff --git a/kcm/src/declarative/qmlscreen.cpp b/kcm/src/declarative/qmlscreen.cpp --- a/kcm/src/declarative/qmlscreen.cpp +++ b/kcm/src/declarative/qmlscreen.cpp @@ -49,6 +49,7 @@ { qDeleteAll(m_outputMap); m_outputMap.clear(); + m_manuallyMovedOutputs.clear(); m_bottommost = m_leftmost = m_rightmost = m_topmost = nullptr; m_connectedOutputsCount = 0; m_enabledOutputsCount = 0; @@ -225,6 +226,8 @@ if (qmlOutput->isCloneMode()) { return; } + if (!m_manuallyMovedOutputs.contains(qmlOutput)) + m_manuallyMovedOutputs.append(qmlOutput); updateCornerOutputs(); @@ -346,7 +349,8 @@ qreal lastY = -1.0; Q_FOREACH (QQuickItem *item, childItems()) { QMLOutput *qmlOutput = qobject_cast(item); - if (!qmlOutput->output()->isConnected() || !qmlOutput->output()->isEnabled()) { + if (!qmlOutput->output()->isConnected() || !qmlOutput->output()->isEnabled() || + m_manuallyMovedOutputs.contains(qmlOutput)) { continue; } @@ -360,7 +364,8 @@ Q_FOREACH (QQuickItem *item, childItems()) { QMLOutput *qmlOutput = qobject_cast(item); - if (qmlOutput->output()->isConnected() && !qmlOutput->output()->isEnabled()) { + if (qmlOutput->output()->isConnected() && !qmlOutput->output()->isEnabled() && + !m_manuallyMovedOutputs.contains(qmlOutput)) { qmlOutput->blockSignals(true); qmlOutput->setPosition(QPointF(lastX, lastY)); lastX += qmlOutput->width() / initialScale * scale;