MDM is central in Linux Mint and at the crossroads of many important technologies, plymouth, bumblebee, upstart, consolekit, Xorg, DE sessions, screensavers… so it needs to work well but also to be easy to maintain.
Originally it was designed as GDM in 2007. At the time features which mattered (XDMCP, Xnest, Solaris support) don’t matter much anymore and new aspects have become very important (Interactive/dynamic UI, user switching, KISS setup tools, simple design). You’ve seen what we did with Mint since 2006, and more recently with projects such as Cinnamon. We’re getting good feedback and we’re very good at developing great software. For this to work though, we need to eliminate technical debt and remove anything that stands in the way of rapid development.
MDM features 3 greeters, 2 of which are themeable. GDM themes let people design themes easily, and HTML5 themes allow people to create interactive and dynamic login screens. As much as possible we want to give artists the ability to create great themes, for them to work reliably and for us to come up with new features and solutions without being restricted by old designs, complexity, and features we don’t need.
With this in mind some 24,500 lines of code were removed from MDM.
Of course that means we removed some features:
- Remote login and XDMCP support
- Xnest/Xephyr nesting
- Server management
- Dynamic servers
- Custom commands
- Solaris support
- Most non-KISS configuration options in mdmsetup (still configurable in /etc/mdm/mdm.conf)
That allowed us to drastically simplify the design:
- Simpler communication protocol between the daemon and the slaves
- No more protocol version checks
- No more legacy support for old GDM protocols
- Everything is now local so a lot of simplification all over the codebase
This simplification of MDM also has visual benefits. Although it might be considered a loss, being more selective with which options are graphically configurable in mdmsetup means the configuration tool for MDM is far less intimidating than before and much more user-friendly.
And already, this pays off in terms of design. Now… I’ll be honest here, most if not all Mint developers are still scared of MDM. But with these 24,500 lines of code removed, I was able to study the design and the various communication protocols used by MDM and I personally feel on top of things when it comes to maintenance now. Everywhere I look I see code we can simplify still, but already things are falling into place.
MDMFlexiServer for instance (which is the command used to interact with the daemon from the command line or to switch user) now has a very simple design. I was able to review it entirely and rewrite the way it works. Switching users (which complement the improvements made to user management and the user applet in Cinnamon 2.0), now works very well.
The ability to “Automatically select the last logged in user” is a feature people asked for for a while. We couldn’t easily implement it because ot the complexity of the MDM design. This is no longer a problem and this feature is now both functional and configurable.
Multi-monitor support is also something we want to fix. Again, a simpler design means we’ll be more efficient in troubleshooting bugs.
Looking forward at technologies such as systemd, wayland, mir, GPU drivers, we want to be able to be reactive, so it’s important for us to own MDM from A to Z, to understand its design fully and to have the flexibility to refactor it anytime the need arises.