[personal profile] mjg59
LightDM's a from-scratch implementation of an X display manager, ie the piece of software that handles remote X connections, starts any local X servers, provides a login screen and kicks off the initial user session. It's split into a nominally desktop-agnostic core (built directly on xcb and glib) and greeters, the idea being that it's straightforward to implement an environment-specific greeter that integrates nicely with your desktop session. It's about 6500 lines of code in the core, 3500 lines of code in the gtk bindings to the core and about 1000 in the sample gtk greeter, for a total of about 11,000 lines of code for a full implementation. This compares to getting on for 60,000 in gdm. Ubuntu plan to switch to LightDM in their next release (11.10).

This is a ridiculous idea.

To a first approximation, when someone says "Lightweight" what they mean is "I don't understand the problems that the alternative solves". People see gtk and think "Gosh, that's kind of big for a toolkit library. I'll write my own". And at some point they have to write a file dialog. And then they need to implement support for handling remote filesystems. And then they need to know whether the system has a functioning network connection or not, and so they end up querying state from Network Manager. And then they suddenly have a library that's getting on for the size of gtk, has about the same level of complexity and has had much less testing because why would you want to use a lightweight toolkit that either does nothing or is 90% of the size of the alternative and crashes all the time.

Adding functionality means that code gets larger. Given two codebases that are of significantly different sizes, the two possible conclusions are either that (a) the smaller one is massively more competently written than the larger one, or (b) the smaller one does less. The gdm authors have never struck me as incompetent, even if some people may disagree with some of their design decisions, and the LightDM authors don't seem to have argued on that basis either. So the obvious conclusion is that LightDM does less.

And, indeed, LightDM does less. Part of this is by design - as the proposal to the Gnome development list shows, one of the key advantages of LightDM is claimed as it not starting a Gnome session. And from that statement alone, we can already see that there's been a massive failure of understanding the complexity of the problem.

Let's go back to the comparisons of code size. LightDM's simple GTK greeter is about 1000 lines of code. gdm's greeter is almost 20,000. Some of this is arbitrary shiny stuff like the slidy effects that occur, but a lot of it is additional functionality. For example, some of it is devoted to handling the interface with AccountsService so gdm can automatically update when users are created or deleted. Some of it is providing UI for accessibility functionality. Some of it is drawing a clock, which I'll admit may be a touch gratuitous.

But if your argument is that your software is better because it's doing less, you should be able to ensure that you can demonstrate that the differences aren't important. And the differences here are important. For example, one of the reasons gdm starts a local gnome session is that it wants gnome-power-manager to be there to handle power policy. Closing the lid of my laptop should suspend the system regardless of whether it's logged in or not. LightDM takes a different approach. Because there's no session, it has to take care of this kind of thing itself. So the backend daemon code speaks to upower directly, and the greeters ask the daemon to implement their policy decisions.

This is pretty obviously miserable. Now you've got two sets of policy - one at the login screen, and one in your session. How do I ensure they're consistent? The only sane solution is to ignore the functionality the backend provides and have my greeter run gnome-power-manager. And now how about accessibility preferences? Again, if I want to have the same selection of policy, I need to run the same code. So you end up with a greeter that's about as complex and large as the gdm one, and unused functionality in the backend. Lighter weight through code duplication. We have always been at war with Eurasia.

The entirety of LightDM's design is based on a false premise - that you can move a large set of common greeter functionality into a daemon and just leave UI presentation up to the greeter code. And if you believe that, then yes, you can absolutely implement a greeter in 1000 lines of code. It'll behave differently to your desktop - the range of policy you can implement will be limited to what the daemon provides, even if your desktop environment has a different range of features. It'll have worse accessibility for much the same reason. And eventually you'll end up with a daemon that's absolutely huge in order to attempt to provide the superset of functionality that each different desktop makes use of.

The only real problem LightDM solves is that it makes it easier to write custom greeters, and if you're really seeking to differentiate your project based on your login screen then maybe your priorities are a little out of line. I'm sure that Ubuntu will release with a beautiful 3D greeter that has a wonderful transition to the desktop. It's just a shame that it won't do any of the useful things that the existing implementations already do.

And if you think that when LightDM finally has the full feature set of gdm, kdm and lxdm it'll still be fewer lines of code and take less memory - I hear the BSD kernel is lighter weight than Linux. Have fun with it.

Design and Bloat

Date: 2011-05-13 10:29 am (UTC)
From: [identity profile] hasenj.myopenid.com
Two things you don't understand:

1. Visual design matters

Gnome is notorious for being ugly. If the only advantage of LDM was its ability to produce a beautiful login screen, then that alone would be enough of an advantage.

The ugliness of gtk (or at least gtk2) is the biggest burden that Ubuntu is carrying, and is perhaps the really big reason of why Ubuntu is still way behind in the market.

2. Bloat is stuff that doesn't matter

Less is more. Who cares about power settings? So what if the screen dims after 10 minutes instead of 20 minutes? The truth is, no one is going to be annoyed by that, because no one leaves their computers at the login screen for that long, and even if they do, it still wouldn't matter because no one will be staring at the computer to be bothered by the display being dimmed or going off.

It just doesn't matter

http://gettingreal.37signals.com/ch05_It_Just_Doesnt_Matter.php

And if it doesn't matter, it's bloat.

Re: Design and Bloat

Date: 2011-05-13 12:03 pm (UTC)
From: (Anonymous)
Yeah, who cares about accessibility? If people are disabled and can’t use a computer, it just doesn’t matter.

Re: Design and Bloat

Date: 2011-05-14 03:11 am (UTC)
From: (Anonymous)
Hmm...

How about writing a front-end for LightDM that's aimed directly at blind...visually impaired...color-blind....

Better yet, do that and make it easy to switch between them (say, a key on the keyboard, or a voice command, or...). And you don't need to write your own implementation to do all this. That's what libraries are for. Use them.

Re: Design and Bloat

Date: 2011-05-16 02:34 am (UTC)
From: (Anonymous)
If your blind, you use either braille or text-to-speech (usually braille, I'd guess), if you're deaf... well, you can still see. If you're both deaf and blind, then braille is the solution for you. If you're color-blind and deaf... you can still see, and you can just switch the theme. If you're visually impaired and deaf, you can either use text-to-speech or braille (or a high-contrast theme)...but I don't think you'd be in much better shape with GDM either.

Now, could you name a set of these conditions that might occur at the same time which would prevent someone from using LightDM and not prevent them from using GDM?

As far as one person needing one, and another person needing another, I addressed that, no?

Re: Design and Bloat

Date: 2011-05-16 03:23 am (UTC)
From: (Anonymous)
Thanks, that's much better. Now, if you would have said that from the beginning...

not everybody is an expert in accessibility, or design, or engineering, or...

Re: Design and Bloat

Date: 2011-05-14 06:56 am (UTC)
From: [identity profile] hasenj.myopenid.com
Obviously accessibility does matter. Most other things however, don't really matter all that much.

> If this functionality didn't matter to someone then it wouldn't be there.

That's how bloat happens.

> But if you're going to make a decision about changing display managers purely because it makes it easier for users to write their own login screens then you should be open about the fact that your goal is more about prettiness than functionality.

I'm pretty sure the Ubuntu project is rather open about aiming for a great user experience. If LDM lacked essential functionality then it wouldn't have been accepted. And, the lack of bloat *is* a feature.

Profile

Matthew Garrett

About Matthew

Power management, mobile and firmware developer on Linux. Security developer at Aurora. Ex-biologist. [personal profile] mjg59 on Twitter. Content here should not be interpreted as the opinion of my employer. Also on Mastodon.

Expand Cut Tags

No cut tags