libs/kworkspace/kdisplaymanager.cpp mess

Martin Briza mbriza at
Mon May 13 14:26:59 BST 2013

On Tue, 07 May 2013 22:47:09 +0200, Rolf Eike Beer  
<kde at> wrote:

> Am Dienstag, 7. Mai 2013, 22:21:46 schrieb Àlex Fiestas:
>> Would be nice to have some kind of unittests on this, that will make a
>> different with the current implementation (which afaik it has none)
> Even better would be to have them first to prove that nothing changed
> afterwards ;)
> Eike

Hi, yes it indeed would be but it seems a bit problematic. Let me explain:

Currently, there are no facilities that allow us to close the once created  
sessions in a way that wouldn't require hacking backend-specific code into  
the tests themselves. Using switchVT method doesn't work as the calls from  
non-active sessions are blocked (at least when using systemd-login).

That basically means the first (clumsy) attempt at test I've added is just  
creating a new session by making the DM open a new greeter on a "reserve"  

You can see what I've done last week and a bit of today's work in branch  
mbriza/kdisplaymanager-split2. I'm sorry for creating a new branch but I  
wasn't allowed to delete neither commits nor the whole branch by the  
server and it was suggested to me to create a new one so far. I'll ask for  
either rights or just deleting the old one eventually.

To what I've done so far and the architecture of the whole thing:

The external API remains completely the same and the KDisplayManager class  
now uses two backends allocated into its static pointers on the first  

The backends are:
  * Desktop Manager (DMBackend)
    - Currently KDM and "Basic" (the rest, i.e. GDM and LightDM which is to  
be renamed to DbusDM I suppose if there aren't any objections).
    - Provides possibility to communicate with the DM itself, most  
importantly to create a new greeter on another VT.
    - I've added a provideSM method to make the DM be able to act as a  
session manager (which is supported only by KDM after removing OldKDM and  
OldGDM support as the more recent projects moved to systemd-login or  
ConsoleKit usage). This is called only when CK or Login1 SM Backend  
initialization fails.
  * Session Manager (SMBackend)
    - Currently KDM, Login1, ConsoleKit and "Basic" (which implements only  
method to start the screensaver to share it with the other ones).
    - Provides methods to control sessions on the current seat, switch  
between them and provide the information to other components.

I'll split the GDM and LightDM code away from the Basic backend some time  
today I think but it's just a few lines of code so not doing it  
immediately won't destroy the idea of the change.

The plans to continue with the work are of course cleaning the Login1  

I'm waiting for your responses and thank you,

More information about the kde-core-devel mailing list