From aab395f07bcfeca487b7736ddc10902d8510768c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 16 Feb 2022 23:55:00 +0000 Subject: [PATCH] Check lockscreen status for fullscreen effects Whilst global shortcuts are blocked by grabbing the keyboard, user set up manual scripts can still invoke a global action. Given we already have code to deactivate when locking it makes sense to also prevent activation. BUG: 450331 --- src/effects/desktopgrid/desktopgrid.cpp | 3 +++ src/effects/overview/overvieweffect.cpp | 3 +++ src/effects/presentwindows/presentwindows.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/effects/desktopgrid/desktopgrid.cpp b/src/effects/desktopgrid/desktopgrid.cpp index 5db35c6961..0828b89e37 100644 --- a/src/effects/desktopgrid/desktopgrid.cpp +++ b/src/effects/desktopgrid/desktopgrid.cpp @@ -68,6 +68,9 @@ DesktopGridEffect::DesktopGridEffect() connect(a, &QAction::triggered, this, [this]() { if ((qreal(timeline.currentTime()) / qreal(timeline.duration())) > 0.5) { + if (effects->isScreenLocked()) { + return; + } activated = true; timeline.setDirection(QTimeLine::Forward); timelineRunning = true; diff --git a/src/effects/overview/overvieweffect.cpp b/src/effects/overview/overvieweffect.cpp index db55b3db27..35968d088e 100644 --- a/src/effects/overview/overvieweffect.cpp +++ b/src/effects/overview/overvieweffect.cpp @@ -155,6 +155,9 @@ void OverviewEffect::toggle() void OverviewEffect::activate() { + if (effects->isScreenLocked()) { + return; + } setRunning(true); } diff --git a/src/effects/presentwindows/presentwindows.cpp b/src/effects/presentwindows/presentwindows.cpp index ff108bf2c4..3a29bc0e6f 100644 --- a/src/effects/presentwindows/presentwindows.cpp +++ b/src/effects/presentwindows/presentwindows.cpp @@ -1592,6 +1592,9 @@ void PresentWindowsEffect::setActive(bool active) return; if (m_activated == active) return; + if (effects->isScreenLocked() && active) { + return; + } m_activated = active; if (m_activated) {