Add ConsoleKit2 support for launching Wayland sessions
ClosedPublic

Authored by erickoegel on Jun 20 2017, 5:56 AM.

Details

Summary

ConsoleKit2 as of version 1.1.1 implements the Session Controller dbus calls required by Kwin to run under Wayland. This patch first looks for the login1 service before attempting the ConsoleKit service.

Test Plan

On a system running ConsoleKit2, logging into a text console and running:

export $(dbus-launch); export QT_QPA_PLATFORM=wayland; startplasmacompositor

Most of this patch is just shuffling code around to support both logind and CK2.

Diff Detail

Repository
R108 KWin
Lint
Lint Skipped
Unit
Unit Tests Skipped
erickoegel created this revision.Jun 20 2017, 5:56 AM
Restricted Application added a project: KWin. · View Herald TranscriptJun 20 2017, 5:56 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript

I'm really happy to see such a change!

I'm wondering whether we should do a larger refactoring and rename the class from Logind to something else. After all with that change it's no longer logind...

How would the thing behave if it's an older consolekit version? Just silently fail like currently?

logind.cpp
111–128

As this part is now basically copied I suggest to turn it into a private method and pass e.g. an enum to indicate whether it's logind or consolekit.

erickoegel updated this revision to Diff 16081.Jul 1 2017, 1:49 PM

Oh wow, I thought I uploaded this new diff ages ago, sorry!

Changes to the diff: switched to using an enum as requested and fixed the VT switch dbus code so it will use CK2's version as well.

I'm wondering whether we should do a larger refactoring and rename the class from Logind to something else. After all with that change it's no longer logind...

If you want I can do that. I was trying to keep the changes small so I don't introduce new bugs as I find and fix any in the ConsoleKit2 implementation.

How would the thing behave if it's an older consolekit version? Just silently fail like currently?
Yes, you'd get the dbus method not found error. Additionally, if ConsoleKit2 doesn't have support for using the session controller (platform that I haven't gotten to yet or it was compiled out) then the TakeControl call will return CK_SESSION_ERROR_NOT_SUPPORTED. The bigger issue is getting libinput ported.

graesslin accepted this revision.Jul 1 2017, 4:40 PM

If you want I can do that. I was trying to keep the changes small so I don't introduce new bugs as I find and fix any in the ConsoleKit2 implementation.

Yes I would also suggest to merge the change without a large refactoring and do that on top now.

Change looks good to me. Do you have commit rights or should I push for you?

This revision is now accepted and ready to land.Jul 1 2017, 4:40 PM

If you want I can do that. I was trying to keep the changes small so I don't introduce new bugs as I find and fix any in the ConsoleKit2 implementation.

Yes I would also suggest to merge the change without a large refactoring and do that on top now.

Change looks good to me. Do you have commit rights or should I push for you?

I don't have commit rights so you'll have to push it. Thanks!

Sorry for the delay, I missed your reply.

This revision was automatically updated to reflect the committed changes.