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
This commit is contained in:
David Edmundson 2022-02-16 23:55:00 +00:00 committed by Vlad Zahorodnii
parent 1b4f3960fd
commit aab395f07b
3 changed files with 9 additions and 0 deletions

View file

@ -68,6 +68,9 @@ DesktopGridEffect::DesktopGridEffect()
connect(a, &QAction::triggered, this, [this]() { connect(a, &QAction::triggered, this, [this]() {
if ((qreal(timeline.currentTime()) / qreal(timeline.duration())) > 0.5) { if ((qreal(timeline.currentTime()) / qreal(timeline.duration())) > 0.5) {
if (effects->isScreenLocked()) {
return;
}
activated = true; activated = true;
timeline.setDirection(QTimeLine::Forward); timeline.setDirection(QTimeLine::Forward);
timelineRunning = true; timelineRunning = true;

View file

@ -155,6 +155,9 @@ void OverviewEffect::toggle()
void OverviewEffect::activate() void OverviewEffect::activate()
{ {
if (effects->isScreenLocked()) {
return;
}
setRunning(true); setRunning(true);
} }

View file

@ -1592,6 +1592,9 @@ void PresentWindowsEffect::setActive(bool active)
return; return;
if (m_activated == active) if (m_activated == active)
return; return;
if (effects->isScreenLocked() && active) {
return;
}
m_activated = active; m_activated = active;
if (m_activated) { if (m_activated) {