diff --git a/src/effects/private/expolayout.cpp b/src/effects/private/expolayout.cpp index 20c0bc84d0..87a72dde21 100644 --- a/src/effects/private/expolayout.cpp +++ b/src/effects/private/expolayout.cpp @@ -36,12 +36,34 @@ void ExpoCell::setLayout(ExpoLayout *layout) m_layout->removeCell(this); } m_layout = layout; - if (m_layout) { + if (m_layout && m_enabled) { m_layout->addCell(this); } Q_EMIT layoutChanged(); } +bool ExpoCell::isEnabled() const +{ + return m_enabled; +} + +void ExpoCell::setEnabled(bool enabled) +{ + if (m_enabled != enabled) { + m_enabled = enabled; + if (enabled) { + if (m_layout) { + m_layout->addCell(this); + } + } else { + if (m_layout) { + m_layout->removeCell(this); + } + } + Q_EMIT enabledChanged(); + } +} + void ExpoCell::update() { if (m_layout) { diff --git a/src/effects/private/expolayout.h b/src/effects/private/expolayout.h index 9f60a0ac21..278a2a4b82 100644 --- a/src/effects/private/expolayout.h +++ b/src/effects/private/expolayout.h @@ -76,6 +76,7 @@ class ExpoCell : public QObject { Q_OBJECT Q_PROPERTY(ExpoLayout *layout READ layout WRITE setLayout NOTIFY layoutChanged) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) Q_PROPERTY(int naturalX READ naturalX WRITE setNaturalX NOTIFY naturalXChanged) Q_PROPERTY(int naturalY READ naturalY WRITE setNaturalY NOTIFY naturalYChanged) Q_PROPERTY(int naturalWidth READ naturalWidth WRITE setNaturalWidth NOTIFY naturalWidthChanged) @@ -91,6 +92,9 @@ public: explicit ExpoCell(QObject *parent = nullptr); ~ExpoCell() override; + bool isEnabled() const; + void setEnabled(bool enabled); + ExpoLayout *layout() const; void setLayout(ExpoLayout *layout); @@ -132,6 +136,7 @@ public Q_SLOTS: Q_SIGNALS: void layoutChanged(); + void enabledChanged(); void naturalXChanged(); void naturalYChanged(); void naturalWidthChanged(); @@ -145,6 +150,7 @@ Q_SIGNALS: private: QString m_persistentKey; + bool m_enabled = true; int m_naturalX = 0; int m_naturalY = 0; int m_naturalWidth = 0; diff --git a/src/effects/private/qml/WindowHeap.qml b/src/effects/private/qml/WindowHeap.qml index 8aff5b2eb5..d35faca3f7 100644 --- a/src/effects/private/qml/WindowHeap.qml +++ b/src/effects/private/qml/WindowHeap.qml @@ -167,6 +167,7 @@ FocusScope { ExpoCell { id: cell layout: expoLayout + enabled: !thumb.hidden naturalX: thumb.client.x naturalY: thumb.client.y naturalWidth: thumb.client.width