From ab190c149b67a8441fd901f8d554ef8fa4f56bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 14 Oct 2014 07:32:42 +0200 Subject: [PATCH] Remove shutdown option from screen locker Logging out from the locked screen is impossible. Logging out means interaction with the session due to the session manager. The session manager asks all applications to quit and applications are allowed to ask for example saving changes. The session manager stopps the logout in this case and asks the window manager to focus this window and the session manager will only continue the logout once the application resolved the situation. At any time in this process the user is still able to abort the logout! Switching to the application which needs interaction is impossible, though as the screen is still locked. The result is a seemingly frozen system as the logout cannot continue and there is no indication what is going on. Of course the lock screen cannot unlock the session for the logout as that would circumvent the security. If the lock screen would unlock one would just have to click the button and abort the logout really fast to have the system unlocked. So this is clearly not an option. The result is: we cannot implement this functionality in a working and secure manner, so it's better to remove it. REVIEW: 120577 BUG: 339453 FIXED-IN: 5.1.1 --- ksmserver/screenlocker/greeter/greeterapp.cpp | 24 ------------- ksmserver/screenlocker/greeter/greeterapp.h | 1 - .../contents/lockscreen/LockScreen.qml | 34 ------------------- 3 files changed, 59 deletions(-) diff --git a/ksmserver/screenlocker/greeter/greeterapp.cpp b/ksmserver/screenlocker/greeter/greeterapp.cpp index fd1d20b82..318687c7d 100644 --- a/ksmserver/screenlocker/greeter/greeterapp.cpp +++ b/ksmserver/screenlocker/greeter/greeterapp.cpp @@ -23,8 +23,6 @@ along with this program. If not, see . #include "sessions.h" #include "authenticator.h" -// workspace -#include // KDE #include #include @@ -182,13 +180,6 @@ void UnlockApp::desktopResized() connect(view->rootObject(), SIGNAL(suspendToDisk()), SLOT(suspendToDisk())); } - QQmlProperty shutdownProperty(view->rootObject(), QStringLiteral("shutdownSupported")); - shutdownProperty.write(canLogout); - if (canLogout && - view->rootObject()->metaObject()->indexOfSignal(QMetaObject::normalizedSignature("shutdown()").constData()) != -1) { - connect(view->rootObject(), SIGNAL(shutdown()), SLOT(shutdown())); - } - m_views << view; } @@ -291,21 +282,6 @@ void UnlockApp::suspendToDisk() Solid::PowerManagement::requestSleep(Solid::PowerManagement::HibernateState, 0, 0); } -void UnlockApp::shutdown() -{ - if (m_ignoreRequests) { - return; - } - - m_ignoreRequests = true; - m_resetRequestIgnoreTimer->start(); - - const KWorkSpace::ShutdownConfirm confirm = KWorkSpace::ShutdownConfirmNo; - const KWorkSpace::ShutdownType type = KWorkSpace::ShutdownTypeHalt; - - KWorkSpace::requestShutDown(confirm, type); -} - void UnlockApp::setTesting(bool enable) { m_testing = enable; diff --git a/ksmserver/screenlocker/greeter/greeterapp.h b/ksmserver/screenlocker/greeter/greeterapp.h index f3033c701..b92b13b63 100644 --- a/ksmserver/screenlocker/greeter/greeterapp.h +++ b/ksmserver/screenlocker/greeter/greeterapp.h @@ -59,7 +59,6 @@ private Q_SLOTS: void resetRequestIgnore(); void suspendToRam(); void suspendToDisk(); - void shutdown(); void getFocus(); void setLockedPropertyOnViews(); diff --git a/lookandfeel/contents/lockscreen/LockScreen.qml b/lookandfeel/contents/lockscreen/LockScreen.qml index 7d730cf1e..8a495ea20 100644 --- a/lookandfeel/contents/lockscreen/LockScreen.qml +++ b/lookandfeel/contents/lockscreen/LockScreen.qml @@ -29,10 +29,8 @@ import "../components" Image { id: root property bool debug: false - property bool shutdownSupported: true property string notification property UserSelect userSelect: null - signal shutdown() signal clearPassword() source: "../components/artwork/background.png" @@ -201,38 +199,6 @@ Image { } } - LogoutOptions { - id: logoutOptions - anchors.right: parent.right - anchors.rightMargin: 5 - canReboot: false - canLogout: false - canShutdown: root.shutdownSupported - mode: "" - exclusive: false - onModeChanged: { - if(mode != "") - stackView.push(logoutScreenComponent, {"mode": logoutOptions.mode }) - } - onVisibleChanged: if(visible) { - mode = "" - } - } - - Component { - id: logoutScreenComponent - LogoutScreen { - canReboot: logoutOptions.canReboot - canLogout: logoutOptions.canLogout - canShutdown: logoutOptions.canShutdown - onCancel: stackView.pop() - - onShutdownRequested: { - root.shutdown() - } - } - } - Component { id: changeSessionComponent BreezeBlock {