Monday, 4 February 2013

So, You want to Write your own Linux Display Server?

UPDATE: It's been confirmed that Ubuntu will be switching to a new display server called Mir. Canonical have posted some FUD about Wayland on the documentation site, and it turns out the Mir devs didn't even understand Wayland enough to make a decision.

Yesterday, OMG! Ubuntu! published a news article stating that Canonical are working on their own display server. If you don't understand the technical details of a display server, what it's job is, and how applications talk to it, then you may think this is a good thing. You may think, “Linux is about choice” or “perhaps this will be better than the alternatives”. But you'd be wrong, horribly wrong.

I have so many problems with this announcement that I thought I'd actually stick my neck out here and put it down on paper. I've been largely driven to this because I have this unfortunate habit of reading comments, and some people tend to comment on topics that they have no knowledge about. This annoys me.

So, let's start from the beginning, what is a display server?

When you write an application, whatever it may be, you normally talk to some API that allows you to write the application without having to get down to the nitty gritty of actually rendering buttons or creating windows. Depending on personal choice, application type, and technical decisions you may choose to use something like Gtk+, or QT or for games SDL.

All of these toolkits talk to what is called a “display server” to do things like, draw the actual buttons, or receive input. Basically a display server is a middleware between your application, and the Linux kernel. But, each of these APIs needs to know how to talk to the display server, they need to be able to say “Hey! Display server! Can you draw me a button over there?” or “Hey! Do you know where the mouse cursor is?” (this explanation is obviously simplified).

For this reason, the display server will define a “protocol” or “language” for the middleware to talk to. All of these APIs talk this language, not only that but applications that need to talk directly to the display server (e.g. Wine) also talk this language.

Until recently, there has been one mainstream protocol called X11, and it's widely adopted. Every graphical Linux application eventually ends up talking X11 and to the display server that talks that language: the xserver.

X11 was invented a really long time ago, and it's served us well, but a lot of the protocol doesn't make sense anymore on modern computers. So, recently a bunch of the developers got together and started defining a better, faster, slicker protocol than X11. This protocol is called Wayland. Wayland supersedes X11, and is designed for modern hardware, as opposed to the hardware of the 1970s. The Wayland protocol has been defined openly, over a couple of years. Everyone has been encouraged to contribute to its development because Wayland needs to cover all use cases.

In summary, there are now two protocols, there's X11 which is heading towards retirement, and Wayland which is destined to replace it. So, despite all the diversity in the Linux ecosystem, despite the different toolkits, and distributions and packaging systems and forks. There has only been one widely adopted display server protocol at a time, and this is a good thing! It means your toolkit or application just has to talk one language and bam, it works across all of the Linux distributions.

Now, Canonical wants to write a new display server, and that in itself is OK, write a new one that talks Wayland and everyone is laughing. Except, they've explicitly stated that Wayland doesn't suit their needs... Wut?

So the protocol that has been defined in the open for the last couple of years, that needed input from all areas so that it fitted all use cases, and actually has had at least one Canonical employee contributing to it doesn't fit their needs?!

This can only imply that they are writing their own protocol, which means that every application, or toolkit API will now need to speak another language. Aside from the legacy X11 and the widely supported Wayland, now everyone will need to code and maintain support for a new one. And this isn't trivial. I've worked with the Wine source code and there are 1000s of lines of code devoted to X11 and I don't think they have even begun to implement support for Wayland. I've also worked on the SDL source code, and again, there are 100s of lines of code in there for X11 and they've already implemented a Wayland backend.

What Canonical is actually doing is not saying “we're going to write a display server” they're saying “we're going to break compatibility with the rest of the Linux ecosystem”. There are two paths forward here, either Canonical themselves implement all the backends for all the toolkits to talk to their new display server, or, they'll use their majority market share to force toolkits themselves to maintain them. Niether of those is pretty, or a small amount of work. Neither benefits users or developers. To break compatibility in this way needs some pretty serious justification.

Going forward I hope that when they said “Wayland doesn't fit our needs” I'm hoping they meant “Weston doesn't fit our needs” (Weston is the reference implementation of the Wayland protocol).

They can by all means implement their own display server, I just really hope that it talks the same language!


  1. For clarity, we didn't state that Canonical _are_ working on their own display server, we asked _if_ Canonical are (based on some snippets of answers given by Jono Bacon).

  2. Thanks so much for this information. I have to let you know I concur on several of the points you make here and others may require some further review, but I can see your viewpoint. website build

  3. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks seo

  4. You guardians do an astounding web diary, and have some unfathomable substance. Continue doing extraordinary. bezoek website

  5. It was truly incredible to discover such an astonishing web journal on the web.
    Google Ranking Your Site

  6. there are multitude free online ways to make money. Most of them have taken grip of these ways to make incredible money and have gained financial freedom too click here

  7. My Essay Writer is the go-to source for the completion of academic assignments. If you are screaming out “write my essay,” you’ve come to the most elite essay writing service

  8. I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. nursing capstone writing service

  9. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. seo posizionamento

  10. It isn't sufficient to work to perfection. You should likewise give the appearances of working to perfection. That is the reason writing great is so essential. Writing great isn't an extra to your activity abilities. It is a focal piece of resume writer

  11. For many people this is important, so check out my profile:
    mason soiza

  12. What an amazing job done by the writer.
    Mason Soiza

  13. New web site is looking good. Thanks for the great effort. seo packages

  14. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. cheap seo service usa

  15. The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface. stonestepsandpaving