Add command line option no-lockscreen to disable lock screen integration

Summary:
WaylandServer provides the initialization flag to disable lock screen
integration. This couldn't be used yet as there is no command line flag
for it. This change adds a new command line argument and hooks up the
functionality.

The no lock screen integration is useful for the embedded use case where
KWin is just used to render one application.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17279
This commit is contained in:
Martin Flöser 2018-12-01 13:17:02 +01:00
parent 8c70600f13
commit 37060a6dd9

View file

@ -672,6 +672,10 @@ int main(int argc, char * argv[])
i18n("Starts the session in locked mode."));
parser.addOption(screenLockerOption);
QCommandLineOption noScreenLockerOption(QStringLiteral("no-lockscreen"),
i18n("Starts the session without lock screen support."));
parser.addOption(noScreenLockerOption);
QCommandLineOption exitWithSessionOption(QStringLiteral("exit-with-session"),
i18n("Exit after the session application, which is started by KWin, closed."),
QStringLiteral("/path/to/session"));
@ -785,6 +789,8 @@ int main(int argc, char * argv[])
KWin::WaylandServer::InitalizationFlags flags;
if (parser.isSet(screenLockerOption)) {
flags = KWin::WaylandServer::InitalizationFlag::LockScreen;
} else if (parser.isSet(noScreenLockerOption)) {
flags = KWin::WaylandServer::InitalizationFlag::NoLockScreenIntegration;
}
if (!server->init(parser.value(waylandSocketOption).toUtf8(), flags)) {
std::cerr << "FATAL ERROR: could not create Wayland server" << std::endl;