Bug 278206

Summary: lightdm integration breaks gdm integration
Product: [Unmaintained] ksmserver Reporter: Oliver Henshaw <oliver.henshaw>
Component: generalAssignee: Alex Fiestas <afiestas>
Status: RESOLVED FIXED    
Severity: normal CC: kevin.kofler, ossi, rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: simple test program based on lightdm/gdm dectection code.
LightDm detection fix

Description Oliver Henshaw 2011-07-21 14:44:10 UTC
Version:           unspecified (using KDE 4.6.4) 
OS:                Linux

"Switch User" -> "New Session" no longer works on a system with gdm as the desktop manager. The reason appears to be that the DM is detected as lightdm (based on some investigation in gdb).


From libs/kworkspace/kdisplaymanager.cpp:KDisplayManager::KDisplayManager()

    if (DMType == Dunno) {
        ...
        else if (::getenv("GDMSESSION")) {
            //lightDM identifies itself as GDM at the moment.
            QDBusReply<bool> reply = QDBusConnection::systemBus().interface()->isServiceRegistered("org.lightdm.LightDisplayManager");
            if (reply.isValid()) {
                DMType = LightDM;
            } else {
                DMType = GDMFactory().isValid() ? NewGDM : OldGDM;
            }
        }
        else
            DMType = NoDM;
    }

AIUI reply.isValid() checks whether the dbus reply is error-free, reply.value() contains the real answer. I'm not a dbus expert, but would the simplest option be to check LightDMDBus().isValid() (as with GDMFactory)?

Reproducible: Always

Steps to Reproduce:
See above.


Expected Results:  
Switching to a new session should take me to the gdm user chooser.

Packages installed:
qt-4.7.3-6.fc15.x86_64
kdebase-workspace-4.6.5-2.fc15.x86_64
gdm-3.0.4-1.fc15.x86_64
Comment 1 Oliver Henshaw 2011-07-21 14:47:53 UTC
Created attachment 62049 [details]
simple test program based on lightdm/gdm dectection code.

$ ./ldm
isValid:  true 
value:  false 
GDMFactory isValid:  true 
LightDMDBus isValid:  false
Comment 2 Oliver Henshaw 2011-07-21 14:55:53 UTC
Also minor nit in the lightdm code - line 93 of
https://projects.kde.org/projects/kde/kdebase/kde-workspace/repository/revisions/b508e6e29274839b8c505b6c5a56f3feed6020f5/diff/libs/kworkspace/kdisplaymanager.cpp
should probably be a QLatin1String, like all the others.
Comment 3 Alex Fiestas 2011-07-21 20:44:04 UTC
Created attachment 62060 [details]
LightDm detection fix
Comment 4 Alex Fiestas 2011-07-21 20:44:21 UTC
Just to be sure, can you test the patch please?

Thanks!
Comment 5 Oliver Henshaw 2011-07-21 22:46:59 UTC
I tested this by rebuilding the fedora srpm with this patch on top and it solves the original user switching problem. Note that this is just with gdm, I don't have lightdm to test that that still works.
Comment 6 Alex Fiestas 2011-07-30 21:42:54 UTC
Good to go then, I will commit it asap and sorry for the mistake :/ I shouldn't backported it :(
Comment 7 Alex Fiestas 2011-07-30 22:05:46 UTC
Git commit 0f5ffd8ee7bd6ed47040d7bc1a85310c5e148109 by Alex Fiestas.
Committed on 30/07/2011 at 23:59.
Pushed by afiestas into branch 'master'.

Test that the actual dbus path is valid, not the reply

Thanks to Oliver Henshaw for the initial patch and bug report
BUG: 278206

M  +1    -2    libs/kworkspace/kdisplaymanager.cpp

http://commits.kde.org/kde-workspace/0f5ffd8ee7bd6ed47040d7bc1a85310c5e148109
Comment 8 Alex Fiestas 2011-07-30 22:07:12 UTC
Git commit de17de196120ab48caa355bb2a3306b37ceb2691 by Alex Fiestas.
Committed on 30/07/2011 at 23:59.
Pushed by afiestas into branch 'KDE/4.7'.

Test that the actual dbus path is valid, not the reply

Thanks to Oliver Henshaw for the initial patch and bug report
BUG: 278206
(cherry picked from commit 0f5ffd8ee7bd6ed47040d7bc1a85310c5e148109)

M  +1    -2    libs/kworkspace/kdisplaymanager.cpp

http://commits.kde.org/kde-workspace/de17de196120ab48caa355bb2a3306b37ceb2691