How to draw a red square in QtQuick

The following is a deceptively unsimple tutorial on how to draw a red square in QML onto a scenegraph.

The normal approach is as follows:

test.qml

import QtQuick 2.0

Item
{
    Rectangle {
        color: "red"
        width: 100
        height: 100
        x: 100
        y: 100
    }
}

Easy.

Going Native

However in some cases, we want a lot more control and to paint something slightly more complex than a red square.

Qt has an API to use the classic QPainter interface to draw our QQuickItems. In order to do this we must create a new QQuickPaintedItem, and register it for use from QML

reditem.cpp

#include <QPainter>
#include <QQuickPaintedItem>

class RedItem : public QQuickPaintedItem
{

    void RedItem::paint(QPainter* painter)
    {
        painter->setBrush(QBrush(Qt::red));
        painter->drawRect(contentsBoundingRect());
    }
}

At some point we need to register our type for qml with

    qmlRegisterType<RedItem>("org.dave", 1, 0, "RedItem");

Our QML file then needs to change to use our new item instead.

Deeper!

Interally the QQuickPaintedItem approach is very different to how the orignal Rectange approach works. Here we are generating a giant pixmap of our red square and uploading it to an openGL texture. Given openGL can draw coloured squares natively this is a rather giant waste of memory and processing.

In order to utilise this behaviour we have to manipulate the scene graph directly.
Scene graph objects are split into two types QSGSimple* and QSG*. The former being a convienient wrapper round the second with some standard functionality.

reditem.cpp

RedItem::RedItem(QQuickItem* parent):
    QQuickItem(parent)
{
    setFlag(QQuickItem::ItemHasContents, true);
}

QSGNode* RedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData*)
{
    QSGSimpleRectNode *rectNode = static_cast<QSGSimpleRectNode*>(oldNode);
    if (!rectNode) {
        rectNode = new QSGSimpleRectNode;
        rectNode->setColor(QColor(Qt::red));
    }
    rectNode->setRect(0, 0, width(), height());
    return rectNode;
}

In updatePaintNode we are given a pointer to the previous node (which may or may not be null) and update any properties on it. We are also able to delete the previous node, and create a new node or return a complex tree of nodes.

As updatePaintNode is called frequently it is a good idea to not update properties that have not changed, as to do so will mark them as "dirty" and perform more calculations on them.

Deeper Still

We can go lower still, and directly write openGL.

We now have 3 parts; The node, a material and a material shader.

The material shader is responsible for actually determining the colours and position of what gets painted.
This is run as two tiny programs that are compiled in the openGL context; the vertex and fragment shader.

In order to not have the same data for every node, there is only ever one shader in use.
Materials act as factory objects for the MaterialShader. Each Node will own a material, which will instantiate and share a single MaterialShader between them.


class RedMaterialShader : public QSGMaterialShader
{
public:
    virtual const char* const* attributeNames() const
    {
        static char const *const attr[] = { "vCoord", 0 };
        return attr;
    }

    virtual const char* vertexShader() const
    {
        return  "attribute highp vec4 vCoord;"
                "uniform highp mat4 matrix;"
                "void main()"
                "{"
                    "gl_Position = matrix * vCoord;"
                "}";
    }

    virtual const char* fragmentShader() const
    {
        //fragment shaders adjust the colour of each pixel
        //there is a special variable gl_FragColor which determines the colour of
        //the pixel at coord
        //in our case, always red
        return "void main() {"
               "  gl_FragColor = vec4(1, 0, 0, 1);" //R, G, B, A
               "}";
    }
    virtual void updateState(const RenderState& state, QSGMaterial* newMaterial, QSGMaterial* oldMaterial)
    {
        if (state.isMatrixDirty()) {
            program()->setUniformValue("matrix", state.combinedMatrix());
            //in reality you want to cache the uniform location to save a lookup on every update
        }
    }

    static QSGMaterialType type;
};

QSGMaterialType RedMaterialShader::type;

class RedMaterial : public QSGMaterial
{
public:
    virtual QSGMaterialShader* createShader() const {
        return new RedMaterialShader;
    }
    virtual QSGMaterialType* type() const {
             return &RedMaterialShader::type;
    }
};

RedItem::RedItem(QQuickItem* parent):
    QQuickItem(parent)
{
    setFlag(QQuickItem::ItemHasContents, true);
}

QSGNode* RedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData*)
{
    QSGGeometryNode *node = static_cast<QSGGeometryNode*>(oldNode);

    if (!node) {
        node = new QSGGeometryNode;

        RedMaterial *m = new RedMaterial;
        node->setMaterial(m);
        node->setFlag(QSGNode::OwnsMaterial, true);

        QSGGeometry *g = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
        node->setGeometry(g);
        node->setFlag(QSGNode::OwnsGeometry, true);
    }

    QSGGeometry::updateTexturedRectGeometry(node->geometry(), QRect(0,0, width(), height()), QRect(0,0,1,1));

    return node;
}

There is a wrapper QSGSimpleMaterialShader, that reduces some of the boilerplate code, but is effectively the same.

Wrap up:

The Qt Quick and SceneGraph libraries are very well structured.

  • You can write QML without ever caring about underlying QQuickItems, but it's there if you need it.
  • You can write QQuickItems wihtout ever caring about the underlying scenegraph, but it's there if you need it.
  • You can write SceneGraph without ever caring about OpenGL, but it's there if you need it.

In general an application developer you should never need to touch scenegraph. The complexity is far higher than using QML. It is designed around speed rather than easy to use APIs. A lot of memory allocation and boiler plate code is the responsibility of the developer.

However, touching scenegraph directly is possible, and nothing to be too afraid of. It is worth having some knowledge in order to understand how the current QML items work underneath and how best to use them.

For those who make libraries; Plasma, Jolla, Ubuntu etc. this is something we will need to do in order to fully make use of the resources available.

Later I will blog about the changes I'm making in Plasma to use this for our custom SVG rendering making use of our existing caches and hopefully share textures and reduce our overall memory footprint.

Code

My examples are available at : git@git.kde.org:scratch/davidedmundson/qtquickplayground

Please note, the above examples deliberately focus on simplicity to explain the point, rather than speed. Additionally this is a new area for me, and I do not claim to be an expert yet. It is worth reading Qt docs heavily and reading through the original Qt code to see how to achieve the best performance.

Making Oxygen work with QtQuickControls

The backstory (an overly abridged history of drawing in Qt)

First we had QWidgets. They provided a set of easy to use components that you might put in an application; buttons, text inputs, combo boxes etc.

In order to make it look nice, as well as integrate on all platforms these widgets don't actually do any drawing themselves. Instead they call a lot of methods in the relevant QStyle and ask the style to draw a frames, render some text, tell it how big spacing should be between various parts. There is an excellent talk about QStyles here.

Widgets a good for making forms, but they aren't suited for drawing animations or custom shapes. So Qt has a framework QGraphicsView, which made it easy to render and manipulate pictures, text and shapes at a graphic level.

Dealing with all these objects in C++ still gets very complicated quickly, so Qt has a way on top of that to create and manipulate these objects using QML, to give us SceneGraph, which is a new underlying drawing technology which only allows use from QML.

QtQuickControls

QtQuick is a great platform, but we still need a way to draw traditional form components, we need a way to blend into the relevant platform and look like it belongs among the existing apps regardless of the technology used.

QtQuickControls provide a way to insert buttons, text, combo boxes etc. into your QtQuick application. Like in QWidgets, QtQuickControls do not do all the drawing themselves but instead have a QML powered style API for rendering/theming widgets.
This differs from the previous Qt Componenents approach in which platforms (such as PlasmaComponents) would redo all of the internal logic, input handling and drawing themselves.

In addition to providing a new style API, a "desktop" style is provided that talks between the QtQuickStyles API and the application QStyle. This means widgets in QtQuickControls will look the same as QWidgets. It works by providing a QML plugin that
can fetch style hints from QStyle, as well as render QStyle contents (such as frames and backgrounds) into textures that can be used from QtQuick.

Before

In theory, if we use QtQuickControls in a QML application and render it in Oxygen, everything will look perfect and "just work".


In practice not so much. The code that makes QtQuickControls use QStyles is undertaking a very complex task and it's very hard to think about all the different ways a style can be (ab)used to render content.

I, with the help of Martin Klapetek and Martin Gräßlin have been working on fixing these issues.
A lot of the work has been going upstream into fixing the code in QtQuickControls in Qt itself, with a few patches into Oxygen to help Oxygen know what type of widget it is styling.

After


There are still a few pixels off, but the result is usable for writing widgets or entire applications in QML in a way that fits in with the rest of the KDE applications.

Tracking Progress / Helping

Progress can be seen on the tracking wiki page. Due to timescales these changes will not be in Qt5.2.0 but as they are bugfixes, should be in Qt5.2.1.

Contact me if you want to help out, in addition it would really help us if someone with a self compiled Qt5 on Windows/Mac can help test our Qt patches to ensure we do not break anything; it will really help up our remaining upstream review requests which have not yet been merged.

Ubuntu Search - An Actual Look

Apologies for the non KDE post on PlanetKDE. I've recently read so much stuff about Ubuntu's "spying", that I feel it's worth clearing the air.

Ubuntu's File Search

This is Ubuntu's file search. It searches files.

So does this send data to the internet?

No, not at all. It searches your files.

So what's the fuss?

The fuss lies in something else, the Ubuntu Dash. There is a lot of confusion about this.

Ubuntu Lenses are a way of searching multiple sources. If we look at the list of available sources it includes web searches such as
Google Books, Reddit, Wikipedia, Youtube, Amazon as well as combining local sources such as applications, local files and menubars. The idea behind it seems to be to create a single unified search bar, abstracting sources from the user. You can search for a song, and not care if the results are local or remote. Pretty neat.

It's quite hard to combine results from the internet, without using the internet, so your search ends up online. Whilst this is encrypted, the results back are not. This is no worse than a search query with Google or Yahoo or any other search engine, and arguably considerably better as you are not later tracked round the web.

Adding Amazon searches by default

In all the search lenses, Amazon is added by default, this gives Canonical money which is fed back into Ubuntu. This is akin to how Mozilla Firefox set the default search provider to Google.

Mozilla earn over $96 million per year for this. KDE Has similar partnerships with enabling DuckDuckGo searches to be manually activated from krunner for a lot lot less.

It's not unheard of in open source communities to make money this way, and whilst I don't think as a user I would like these ads I can't really hold it against them.

So how bad is it?

Canonical does not have your file contents, they don't even have a list of your files, nor do they track all key presses.
At best, there is a record of a search term linked to an IP address, which may of may not be part of a file name. It's not a lot of private data, and it's not linked to you as a named individual.

The claim by the EFF, is not about the possibility of Canonical 'spying' on you. The claim is that a hacker sniffing your network traffic could infer from the from the images returned from Amazon what you are searching for.

Personally I consider this a very weak claim, if someone is sniffing your network traffic your are more likely to give away personal information in other ways, such as any browsing. It's the EFF's job to err on the side of extreme caution and to provide information. It's up to us as the wider community to balance this with pragmatism and to keep things within proportion.

Edit: And this potential issue has since been addressed for 13.10, all data back is also encrypted, addressing the main point from the EFF. Thanks to Michael Hall for the updated information.

So why is it called spyware by some people?

There is a traditional gap between web and local applications, people ignorant of what the dash search does, mistakenly take this for a simple file search. For a file search to use the web would clearly be wrong. The majority of the complaints and criticisms I have read do not come from Ubuntu users who have seen the Ubuntu bar. To any user of the Ubuntu search bar, it should be obvious that it includes internet results due to the high visibility of the internet results within moments of usage.

If we always try to pander to the notion of treating web and local data as two completely separate distinct entities desktop Linux will always be held behind the web applications that are able to employ much richer content. I don't want to have to be at a point where Firefox has to provide a prompt to explicitly state that it will use a network connection.

Spies (with the exception of James Bond) are also secretive. The Ubuntu dash makes no effort to hide exactly what it is doing. Whilst it may not be the world's greatest or most useful feature, this isn't something that spies.

To call it spyware is a blatant lie, to call it a privacy invasion I think is a massive exaggeration of a rather minor concern that misunderstands the goals of the dash.

Image credits: http://webupd8.org and http://ichibikarin.blogspot.com.es

KDE Telepathy 0.7.0 Released

Today we are happy to announce a new version of KDE Telepathy, KDE's instant messaging client.

KDE Telepathy is a suite of applications and plasmoids to allow chatting, file transfer, video calls etc (where available). over popular instant messaging networks. Facebook, Google Talk, Jabber, SIP, and many many more putting all your instant messaging in one place - on your desktop.

Since the Beta

If you have already seen the beta announcement you may as well skip to the end, all the following content is exactly the same. Since the beta we have not added any features but fixed any issues that arose.

It's been a long time since the beta because KTp has a "we do not release until all major bugs are fixed" policy. Hopefully it will be worth the wait.

Features

New backends support

Instant messaging is a constantly evolving platform. There was a time when everyone important was on AOL instant messaging, now that's unlikely. This evolving landscape is one of the main reasons for using Telepathy as our backend which is used my multiple clients.

We not only have our own backends, but can support everything provided by libpurple. We've looked at some of the up and coming libpurple backends and added the small amount of code to make everything available. In this release we now support setting up Steam and Groupwise accounts, if the relevant libpurple backends are available.

Due to the clever separated architecture of the Telepathy framework, unstable backends do not cause instability in the main application.

In addition we are working on developing our own backends, a GSOC student this summer has developed support for sending SMS messages via ModemManager.

More Text Filtering Plugins

Send LaTeX formula in chats!

We've ported some of our favourite plugins from Kopete, and now we are able to send LaTeX maths formula to each other, great for when you're stuck on the class assignment.

Short URL Expansion

This new plugin automatically expands any shorterned URL to see where it redirects to. No more nasty surprises.

Collaborative Editing

As a Google Summer of Code project, collaborative text editing was added to kde-telepathy. Most prominently, there's now a "Collaboratively edit a document" button in the chat window, which allows you to edit a document together with a contact without any setup being required (except for you and your contact installing the application, of course). Instead of introducing a new dedicated collaborative editor, this feature integrates with existing KDE applications, such as Kate or KDevelop.

This works by using a technology called Telepathy Tubes, which defines a way to use Jabber to open a TCP connection to a contact in the best most efficient way possible. In most cases, it should use a proxy server, but if a direct connection without a proxy is possible, it will prefer that. If even the proxy does not work, it can also fall back to transferring data directly over the Jabber server, which is a bit slower, but works for every environment.

Documentation on how to use and install this feature is available here. A more in-depth announcement of the current release is here.

Contact Aggregation

The advantage of using a multi protocol instant messaging client is we are able to show all your accounts in once place. However, this can lead to multiple entries for the same contact across different services.
We are now able to join multiple contacts together, we've introduced a user-interface that allows you to choose to ignore the technical details and start chats quickly or provide fine-grained control as required.

We provide this by adding support for libkpeople - a new system-wide KDE metacontact library aggregating information from all contact sources not just instant messaging contacts but also your local address books, Facebook Feeders, Google contacts, LDAP servers and anything else that provides contacts.

Libkpeople works by syncing contact data from all sources into Nepomuk, this means that in addition to grouping instant messaging contacts together we can also interact with data from other sources. We can see email addresses, phone numbers addresses and start a range of actions.

As this includes both a Nepomuk dependency and a new library we've opted for having two modes, one with the additional features and the other without. If you don't run Nepomuk you will still have original contact list working as before.

In this release we are only adding small subset of new features KPeople is going to provide as it is still very much a work in progress. We wanted to ship this now, to give basic metacontact support setting the buildling blocks for the more advanced features.

Note as this is a new library, your distribution may or may not have this supported.

Fixes Galore

In addition to all the new features we have been working on fixing lots of additional papercuts throughout the rest of KDE Telepathy.

There have been over 1000 commits since 0.6 and over 300 bugs resolved.

Getting The 0.7 Release

KTp 0.7.0 is available at http://download.kde.org/unstable/kde-telepathy/0.7.0/; packages should be available in some of the major distributions shortly.

If you encounter any problems with the release, please file bugs on our bug tracker

Getting Involved

As always we need new developers, we have a lot of exciting new features planned for 0.8.

You can find out more about getting involved here on our wiki.

KTp Facebook Instant Messaging Problems

Many of you in recent weeks have probably faced problems with Facebook XMPP's server. They are migrating to new servers which have had their share of problems, causing KDE Telepathy clients to display the following:

Not everyone is affected at the same time due to a gradual roll out by Facebook.

Fixing this problem

This particular problem is caused by a non RFC compliance in Facebooks XMPP service.
I don't mean to blame the Facebook developers here, everyone makes mistakes, especially when dealing with XMPP :)

In this particular case they are missing a parameter which, whilst required by the specification, is not practically needed. Our library then assumes something is wrong and quits.

Thanks to help from users at http://forum.kde.org I was able to reproduce the problem.

I have added a workaround in the Telepathy Gabble backend to resolve this issue which should fix KTp, Empathy, and other Telepathy users (including the Nokia N9 if they were to make a new release). Other upstream developers helped spring into action to clarify RFCs, add regression tests and backport into 3 different stable releases.

It really highlights the importance and advantages of sharing backends.

Moving forwards

In order to prevent problems like this in the future I am now a member of the Facebook XMPP developer relations group. In addition I now connect to a beta version of the Facebook Chat gateway so we can spot and communicate errors faster.

Summary

Upgrade telepathy gabble to the latest version (0.18.1) and this problem should go away. Backports are coming soon.

Season of KDE 2013 Applications Open

Season of KDE is now officially open for applications.

To apply head to http://season.kde.org register as a student and click "Submit a proposal"

What is Season of KDE?

Season of KDE is a community outreach program, much like Google Summer of Code that has been hosted by the KDE community for five years straight.

It is meant for people who could not get into Google Summer of Code for various reasons, or people who simply prefer a differently structured, somewhat less constrained program. Season of KDE is managed by the same team of admins and mentors that take care of Google Summer of Code and Google Code-in matters for KDE, with the same level of quality and care.

Who can take part?

Everyone can apply for Season of KDE. We give preference to those who have applied for Google Summer of Code and to students, but we will gladly consider applications from anyone.

What do I get out of this?

A great summer working on a really cool KDE project and gaining valuable experience. If you complete your project successfully you also get a T-shirt, a certificate, and maybe a few other goodies.

What is the timeline?

Season of KDE is a flexible project to fit around school terms, work, and other commitments, and start and end dates can be discussed with your mentor. Projects should be completed before the end the year, a typical Season of KDE project should take around 2 months.

How do I apply?

First get in touch with a mentor about your ideas, and what projects they want to run.

Then head to http://season.kde.org and follow the instructions.

Do I need to have a mentor before applying?

It is preferred. Ideally, you should contact a KDE subproject well before applying, ask for feedback on your idea if you have one, and request a mentor directly. A list of KDE subproject contacts is available on the Google Summer of Code 2013 ideas page. You can also apply without a mentor and we will try to find one for you.

Do I need to have a project idea before applying?

It is preferred. If you do not have one we will try to find one for you. Keep in mind that the KDE community is pretty big, so you should at least have an idea of which KDE subproject you wish to work on.

Do I need to write a proposal like in Google Summer of Code?

No, but we would like to see a brief project plan describing what you will be working on.

Is it only for coders like Google Summer of Code?

We are willing to consider non-coding projects as well including artwork and promotion, but you should definitely get in touch to figure out the details beforehand. The KDE Community Wiki describes ways to get involved with KDE that do not require coding.

I applied for a project in Google Summer of Code but another student got selected for it. Can I still work on it?

Maybe, but likely not. You should ask the mentor that was assigned to your idea. We can try to find something related for you if you want, or something completely different. Let us know what you wish and we will do our best to accommodate your request.

Is this an extension of Google Summer of Code or connected to Google?

No. While Season of KDE is in many ways modeled after Google Summer of Code and administered by the same members of the KDE community, it is completely independent from Google Summer of Code and has no connection to Google whatsoever.

For further questions feel free to join our IRC channel #kde-soc on Freenode or email the admin team at kde-soc-mentor-owner@kde.org.

KDE Telepathy 0.6.3 Released

We have just released version 0.6.3 of KDE Telepathy, the instant-messaging client for KDE.

This is a bug fix release in the 0.6 series adding further robustness and completeness.

Fixes include:

  • Better invalid SSL certificate handling
  • Improved keyboard navigation
  • Fixed "respond" button not always working in Plasma notifications

A more complete list is available here.

Updated packages are coming for most major distributions.

KTp 0.6.2 Released

We have just released version 0.6.2 of KDE Telepathy, KDE's instant messaging client.

This new minor release brings some important fixes on some crashes that occurred in rare conditions that we hadn't found before our initial release.

Crash Fixes

Bug Fixes

  • 318663: Esc key when filtering contacts does not reset filter model
    Git Commit
  • 318751: Groupwise logs imported from Kopete are displayed with HTML tags in chat window.
    Git Commit
  • 319162: Contact tooltips miss presence icon since model porting
    Git Commit

Getting Involved

As always we welcome new contributors, we are about to merge in some very exciting new changes, and it's a good time to get involved in testing and hacking.
The best way to get a new feature is to write it :)

For details please see our wiki page at http://community.kde.org/KTp/Getting_Involved

A Sneak Peek at KTp Active

About

No tablet would be complete without instant messaging. Thanks to awesome bachelor thesis work we had a non-working mockup of an active client. This active client remains separate from our desktop work.

In recent weeks I've been transforming this code to go from a non-working prototype to something working with real contact lists and text chats.

How to set up the latest ktp-active

Install the latest version of plasma-mobile-components. Personally I use project-neon for this to keep a separate environment.

Install the latest (git master, not 0.6.1) of ktp-common-internals

You will need to open system settings and change your workspace theme to "Air Mobile".

git clone git://anongit.kde.org/ktp-active

Change directory to application/package and run "plasmoidviewer"

You will need to set up your accounts using either our desktop Accounts KCM Module, or manually using the mc-tool command line tool.

This sounds awesome, how can I get involved?

See our KTp wiki page http://community.kde.org/KTp/Getting_Involved
We have a wiki page for the active project, which lists some tasks to be done. We are not accepting bug reports on ktp-active at this point.

Ping me (d_ed) on IRC for details.

KDE, LightDM and the Mir Kerfuffle

With Canonical's decision to make a new display server, there's been some questions as to how this affects LightDM and the KDE front end I've spent a long time working towards.

It's a perfectly sensible question, LightDM has heavy Canonical sponsorship, and a display server needs to be supported in the display manager.

Canonical (and Ubuntu) have decided not to adopt Wayland as their new display server, but a new in-house system called Mir. We in KDE have already made the decision that Wayland is the future, and work in kwin has already begun on that. Having a Display Manager that supports a Wayland system compositor is essential to our long term strategy.

I've been asked to address this a lot, so I'll put my thoughts in a blog post.

The back story

After a bad experience customising KDM for a really important and scary client I wanted to redo the UI and customisation experience of KDM.

I wanted to rewrite the whole UI and config side, so started looking through KDM code. It was around this time Robert Ancell posted about LightDM, a new display manager that aimed to be greeter agnostic. This was around 2 years ago when everyone was getting excited over Wayland, it was clear it was in LightDMs roadmap.

This seemed like a win, win situation. I get an easier platform to write my new login manager on *and* I get to bring Wayland support to KDE.

I wrote Qt bindings around LightDM upstream, along with a reference QWidget based greeter. I then started working on the KDE greeter in our repository.

The KDE greeter is approaching version 0.4. It is included in many distros, and generally feedback has generally been very positive.

The current state

Whilst LightDM is made by Canonical it is community driven and all patches go through review where anyone can comment. I have an opportunity to argue if anything is greeter specific in the libraries.

LightDM is used by my KDE greeter (used in some distros, not all), XFCE, and Razor Qt and of course Unity.

The Qt library was originally only used by us and Razor Qt, but with Unity's move to QML this means that Canonical are now dependant on the libraries I made. I am still in charge of the Qt library and still get final say on all reviews, I have rejected some Canonical employee patches as needing a rewrite and them with some of mine, it feels like a real open meritocracy community.

The rant

The golden-egg of using LightDM in KDE was that we wouldn't have to support all the boring things we need to make a display manager work, we wouldn't need to support a Wayland system compositor we get it for free. We all write stuff that helps each and open source progresses faster.

If I'd known they weren't going to add Wayland support, I'm not sure I would have invested my time in LightDM. I don't feel decieved, they thought they would do it at the time and Canonical are perfectly within their rights to decide to do something else.

The problem for me isn't that Canonical changed their mind, but that they didn't (or the developers weren't allowed) to tell me! If you know for 6 months that you're not going to do something you said you would it's rude not to tell people. It now sets our schedule back and that's really really frustrating.

Where does this leave us?

The state of LightDM hasn't got _worse_ however it does mean we need to add Wayland support ourselves. I've heard the argment; if we need to add Wayland support in something else, is it worth using it? I've been asked to address this, I'm writing this blog post to express my feelings, then I'll be having a meeting later this week to discuss things.

Our requirements are:

  • We need to have a display manager that works in Qt5 in the very near future.
  • We need a display manager that supports Wayland as a system compositor in the medium term.
  • Our options are:

  • Patch KDM to support X and Wayland (something hard to do, this code is built on top of XDM) AND fix Qt5 support (again not trivial in this case)
  • Write something new from scratch. In this case we still need to write a Wayland system compositoranyway!
  • Patch LightDM to also support Wayland (given it's already switching between Mir and X, the infrastructure is in place, it's designed to be able to switch backends and we have half-done Wayland patches to start with). It already all works in Qt5.
  • Writing a display manager is one of the things that sounds simple but in reality is very difficult; but there's a lot of stuff behind the scenes which is really difficult to get right: a tonne of environment variables to set, Xauthority files to set up, .dmrc files to manage, all sorts of session hooks let alone remote sessions and security.

    From the above, I think my viewpoint on the matter is pretty clear, we just have a bit more work ahead than I'd initially hoped for.

    That said, I will be having a meeting with a few interesed parties later this week to discuss future direction.