Load a Wallpaper plugin in kscreenlocker_greet
ClosedPublic

Authored by graesslin on Jun 8 2016, 4:21 PM.

Details

Summary

With this change the greeter loads a configured Wallpaper Plugin. The
idea behind this is to bring back the possibility of "animation" into
the lockscreen and to replace the rather hacky solution for a custom
background image.

As this is security relevant code we need to consider the security
implications of such a change. The existing code already allows to load
different QML files through the lookandfeel infrastructure. Given that
local data can be loaded anyway and network data is blocked.

For a proper integration there are further changes needed:

  • config interface needs to make wallpaper plugins configurable
  • default lnf package needs to "remove" the rendered image to be able to see the wallpaper
  • blurred lockscreen background by default
  • config transition for custom wallpaper images

To test manually edit kscreenlockerrc and add the following:
[Greeter]
WallpaperPlugin=org.kde.hunyango

And modify the lookandfeel package to be an Item instead of an Image.

Diff Detail

Repository
R133 KScreenLocker
Branch
wallpaper-plugin
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin updated this revision to Diff 4295.Jun 8 2016, 4:21 PM
graesslin retitled this revision from to Load a Wallpaper plugin in kscreenlocker_greet.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptJun 8 2016, 4:21 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik added inline comments.
greeter/greeterapp.cpp
198

qobject_cast

200

"Wallpaper needs to be a QtQuick Item"

204

item->setZ(-1000);

322

object->completeInitialization({

{QStringLiteral("width"), view->width()},
{QStringLiteral("height"), view->height()}

});

greeter/wallpaper_integration.cpp
34

using namespace?

41

qmlRegisterType<...>(); ?

52

emit configurationChanged, or, reuse the ConfigPropertyMap and reset it with the new config (if that's possible, don't know the API) and make the Q_PROPERTY CONSTANT

greeter/wallpaper_integration.h
43

Add empty line between Q_OBJECT and Q_PROPERTY

46

Empty line here too

55–56

Don't we usually have the getter before the setter?

graesslin marked 7 inline comments as done.Jun 9 2016, 12:59 PM
graesslin added inline comments.
greeter/wallpaper_integration.cpp
34

I prefer having a huge namespace around the implementation of a class which is in the namespace.

41

It's used as a Q_PROPERTY, so qRegisterMetaType. At least that's what it complained about when I run it :-P

52

actually it could be a CONSTANT property as it won't change in the runtime of kscreenlocker_greet.

But what if the wallpaper binds to the change signal? Will that then raise a runtime error or is it allowed to do that?

graesslin updated this revision to Diff 4309.Jun 9 2016, 12:59 PM

Adressed some of Kai-Uwe's comments

graesslin updated this revision to Diff 4345.Jun 12 2016, 9:26 AM

Start of configuration:
a new combobox is added to the config module which is filled with
the available wallpaper plugins. The currently configured wallpaper
plugin is selected and when changed the selected plugin gets saved
to the config. The greeter picks the new configured plugin.

So far so good. What's still missing is configuring the actual plugin.
I'm a little bit stuck there. I see that the plugins have a config.qml
with properties which look a lot like kcfg keys, but I don't understand
how those properties get initialized.

graesslin updated this revision to Diff 4380.Jun 13 2016, 9:12 AM

Integrated wallpaper configuration. It works (loads and saves correctly),
but the QtQuick integration needs a look from experts

[14:17] <mgraesslin> jensreu: so you ack that we remove the blurred variant in the lockscreen by default?
[14:17] <jensreu> mgraesslin: yes

So the problematic area of how to get the blurred wallpaper is scratched.

mart accepted this revision.Jun 28 2016, 9:01 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Jun 28 2016, 9:01 AM