Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions src/core/lockscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

#include "interfaces/lockscreeninterface.h"
#include "output/output.h"
#include "seat/helper.h"

Check warning on line 8 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "seat/helper.h" not found.
#include "utils/cmdline.h"

Check warning on line 9 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "utils/cmdline.h" not found.
#include "common/treelandlogging.h"

Check warning on line 10 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "common/treelandlogging.h" not found.
#include "greeter/greeterproxy.h"

Check warning on line 11 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "greeter/greeterproxy.h" not found.

#ifdef EXT_SESSION_LOCK_V1
#include <wsessionlock.h>

Check warning on line 14 in src/core/lockscreen.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wsessionlock.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <wsessionlocksurface.h>

#include "rootsurfacecontainer.h"
Expand All @@ -20,9 +21,10 @@

WAYLIB_SERVER_USE_NAMESPACE

LockScreen::LockScreen(ILockScreen *impl, SurfaceContainer *parent)
LockScreen::LockScreen(ILockScreen *impl, SurfaceContainer *parent, GreeterProxy *greeterProxy)
: SurfaceContainer(parent)
, m_impl(impl)
, m_greeterProxy(greeterProxy)
, m_delayTimer(std::make_unique<QTimer>(new QTimer))
{
connect(m_delayTimer.get(), &QTimer::timeout, this, &LockScreen::unlock);
Expand All @@ -40,10 +42,8 @@

setVisible(true);

for (const auto &[k, v] : m_components) {
v->setProperty("currentMode", static_cast<int>(LockScreen::CurrentMode::Lock));
QMetaObject::invokeMethod(v.get(), "start", QVariant::fromValue(true));
}
if (!m_greeterProxy->isLocked())
m_greeterProxy->lock();
}

void LockScreen::shutdown()
Expand All @@ -61,10 +61,8 @@

setVisible(true);

for (const auto &[k, v] : m_components) {
v->setProperty("currentMode", static_cast<int>(LockScreen::CurrentMode::Shutdown));
QMetaObject::invokeMethod(v.get(), "start", QVariant::fromValue(true));
}
if (!m_greeterProxy->showShutdownView())
m_greeterProxy->setShowShutdownView(true);
}

void LockScreen::switchUser()
Expand All @@ -82,10 +80,7 @@

setVisible(true);

for (const auto &[k, v] : m_components) {
v->setProperty("currentMode", static_cast<int>(LockScreen::CurrentMode::SwitchUser));
QMetaObject::invokeMethod(v.get(), "start", QVariant::fromValue(true));
}
Q_EMIT m_greeterProxy->switchUser();
}

void LockScreen::addOutput(Output *output)
Expand All @@ -105,10 +100,6 @@

auto *item = m_impl->createLockScreen(output, this);

if (isVisible()) {
QMetaObject::invokeMethod(item, "start", QVariant::fromValue(false));
}

connect(item, SIGNAL(animationPlayed()), this, SLOT(onAnimationPlayed()));
connect(item, SIGNAL(animationPlayFinished()), this, SLOT(onAnimationPlayFinished()));

Expand Down Expand Up @@ -314,10 +305,7 @@
}
m_fallbackItems.clear();

for (const auto &[k, v] : m_components) {
v->setProperty("currentMode", static_cast<int>(LockScreen::CurrentMode::Lock));
QMetaObject::invokeMethod(v.get(), "start", QVariant::fromValue(true));
}
m_greeterProxy->lock();
}

void LockScreen::createFallbackItem(WOutputItem *outputItem)
Expand Down
4 changes: 3 additions & 1 deletion src/core/lockscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

#include "surface/surfacecontainer.h"
#include "wglobal.h"
#include <map>

Check warning on line 8 in src/core/lockscreen.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <map> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <memory>

Check warning on line 9 in src/core/lockscreen.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <memory> not found. Please note: Cppcheck does not need standard library headers to get proper results.

class GreeterProxy;
class QTimer;
class ILockScreen;

Expand Down Expand Up @@ -35,7 +36,7 @@
};
Q_ENUM(CurrentMode)

explicit LockScreen(ILockScreen *impl, SurfaceContainer *parent);
explicit LockScreen(ILockScreen *impl, SurfaceContainer *parent, GreeterProxy *greeterProxy);

bool available() const;
bool isLocked() const;
Expand Down Expand Up @@ -71,6 +72,7 @@

private:
ILockScreen *m_impl{ nullptr };
GreeterProxy *m_greeterProxy{ nullptr };
std::map<Output *, std::unique_ptr<QQuickItem, void (*)(QQuickItem *)>> m_components;
std::unique_ptr<QTimer> m_delayTimer;
#ifdef EXT_SESSION_LOCK_V1
Expand Down
40 changes: 6 additions & 34 deletions src/core/qml/PrimaryOutput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -120,44 +120,16 @@ OutputItem {
target: wallpaper
scale: 1.4
}
},
State {
name: "ScaleWithoutAnimation"
PropertyChanges {
target: wallpaper
scale: 1.4
}
}
]

transitions: [
Transition {
from: "*"
to: "Normal"
PropertyAnimation {
property: "scale"
duration: 1000
easing.type: Easing.OutExpo
}
},
Transition {
from: "*"
to: "Scale"
PropertyAnimation {
property: "scale"
duration: 1000
easing.type: Easing.OutExpo
}
},
Transition {
from: "*"
to: "ScaleWithoutAnimation"
PropertyAnimation {
property: "scale"
duration: 0
}
Behavior on scale {
enabled: GreeterProxy.showAnimation
NumberAnimation {
duration: 1000
easing.type: Easing.OutExpo
}
]
}
}
}

Expand Down
Loading
Loading