diff -Nuar sddm-0.11.0/ChangeLog sddm-master/ChangeLog
--- sddm-0.11.0/ChangeLog	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/ChangeLog	2015-03-08 18:18:48.000000000 +0200
@@ -4,6 +4,10 @@
     - Bug fixes
     * Others
 
+## 0.12.0 - XXXX-XX-XX
+----------------------
+    * Add Arabic translation by Safa Alfulaij.
+
 ## 0.11.0 - 2014-11-20
 ----------------------
     + Reload the configuration every time we start a new session
@@ -15,7 +19,6 @@
 
 ## 0.10.0 - 2014-10-16
 ----------------------
-
     + Set default icon theme from greeter theme configuration.
     + Set cursor theme according to greeter theme configuration.
     - Never permit a login as the sddm user (CVE-2014-7271)
diff -Nuar sddm-0.11.0/CMakeLists.txt sddm-master/CMakeLists.txt
--- sddm-0.11.0/CMakeLists.txt	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/CMakeLists.txt	2015-03-08 18:18:48.000000000 +0200
@@ -77,7 +77,9 @@
 
 # find qt5 imports dir
 get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
-exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML" RETURN_VALUE return_code OUTPUT_VARIABLE QT_IMPORTS_DIR)
+if(NOT QT_IMPORTS_DIR)
+    exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_QML" RETURN_VALUE return_code OUTPUT_VARIABLE QT_IMPORTS_DIR)
+endif()
 
 # Set components version
 set(COMPONENTS_VERSION 2.0)
@@ -98,7 +100,12 @@
     add_definitions(-DHAVE_SYSTEMD)
     set(CMAKE_AUTOMOC_MOC_OPTIONS -DHAVE_SYSTEMD)
 
-    pkg_check_modules(JOURNALD "libsystemd-journal")
+    # libsystemd-journal was merged into libsystemd in 209
+    if(${SYSTEMD_VERSION} VERSION_LESS 209)
+        pkg_check_modules(JOURNALD "libsystemd-journal")
+    else()
+        pkg_check_modules(JOURNALD "libsystemd")
+    endif()
 
     if(ENABLE_JOURNALD)
         if(JOURNALD_FOUND)
@@ -109,8 +116,11 @@
         endif()
     endif()
 
-    execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=systemdsystemunitdir systemd OUTPUT_VARIABLE SYSTEMD_SYSTEM_UNIT_DIR)
-    string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SYSTEM_UNIT_DIR ${SYSTEMD_SYSTEM_UNIT_DIR})
+    if (NOT DEFINED SYSTEMD_SYSTEM_UNIT_DIR)
+        execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=systemdsystemunitdir systemd OUTPUT_VARIABLE SYSTEMD_SYSTEM_UNIT_DIR)
+        string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SYSTEM_UNIT_DIR ${SYSTEMD_SYSTEM_UNIT_DIR})
+    endif()
+
     set(MINIMUM_VT 1)
     set(HALT_COMMAND "/usr/bin/systemctl poweroff")
     set(REBOOT_COMMAND "/usr/bin/systemctl reboot")
diff -Nuar sddm-0.11.0/CONTRIBUTORS sddm-master/CONTRIBUTORS
--- sddm-0.11.0/CONTRIBUTORS	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/CONTRIBUTORS	2015-03-08 18:18:48.000000000 +0200
@@ -43,3 +43,4 @@
 a.k.a. Harvey <teknocratdefunct@riseup.net>
 raffarti <raffarti@zoho.com>
 w41l <walecha99@gmail.com>
+Sérgio Marques <smarquespt@gmail.com>
diff -Nuar sddm-0.11.0/data/man/sddm.conf.rst.in sddm-master/data/man/sddm.conf.rst.in
--- sddm-0.11.0/data/man/sddm.conf.rst.in	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/man/sddm.conf.rst.in	2015-03-08 18:18:48.000000000 +0200
@@ -65,6 +65,10 @@
 	Path of the X server.
 	Default value is "/usr/bin/X".
 
+`XephyrPath=`
+	Path of the Xephyr.
+	Default value is "/usr/bin/Xephyr".
+
 `XauthPath=`
 	Path of the Xauth.
 	Default value is "/usr/bin/xauth".
@@ -104,11 +108,11 @@
 	Default value is 65000.
 
 `HideUsers=`
-	Users that shouldn't show up in the user list.
+	Comma-separated list of Users that shouldn't show up in the user list.
 	Default value is empty.
 
 `HideShells=`
-	Shells of users that shouldn't show up in the user list.
+	Comma-separated list of Shells of users that shouldn't show up in the user list.
 	Default value is empty.
 
 `RememberLastUser=`
diff -Nuar sddm-0.11.0/data/man/sddm.rst.in sddm-master/data/man/sddm.rst.in
--- sddm-0.11.0/data/man/sddm.rst.in	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/man/sddm.rst.in	2015-03-08 18:18:48.000000000 +0200
@@ -25,9 +25,9 @@
 easily create pleasant, modern looking interfaces for sddm.
 
 sddm runs the greeter as a system user named **sddm**
-whose home directory need to be set to **/var/lib/sddm**.
+whose home directory needs to be set to **/var/lib/sddm**.
 
-If pam and systemd are available, the greeter will go through logind
+If pam and systemd are available, the greeter will go through logind,
 which will give it access to drm devices.
 
 Distributions without pam and systemd will need to put the **sddm** user
diff -Nuar sddm-0.11.0/data/scripts/Xsession sddm-master/data/scripts/Xsession
--- sddm-0.11.0/data/scripts/Xsession	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/scripts/Xsession	2015-03-08 18:18:48.000000000 +0200
@@ -20,9 +20,8 @@
       . $HOME/.profile
     fi
     ;;
-  */zsh)
+*/zsh)
     [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
-    emulate -R sh
     [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
     zhome=${ZDOTDIR:-$HOME}
     # zshenv is always sourced automatically.
@@ -30,6 +29,7 @@
     [ -f $zhome/.zprofile ] && . $zhome/.zprofile
     [ -f $zdir/zlogin ] && . $zdir/zlogin
     [ -f $zhome/.zlogin ] && . $zhome/.zlogin
+    emulate -R sh
     ;;
   */csh|*/tcsh)
     # [t]cshrc is always sourced automatically.
diff -Nuar sddm-0.11.0/data/translations/ar.ts sddm-master/data/translations/ar.ts
--- sddm-0.11.0/data/translations/ar.ts	1970-01-01 02:00:00.000000000 +0200
+++ sddm-master/data/translations/ar.ts	2015-03-08 18:18:48.000000000 +0200
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ar">
+<context>
+    <name>TextConstants</name>
+    <message>
+        <source>Welcome to %1</source>
+        <translation>مرحبًا في %1</translation>
+    </message>
+    <message>
+        <source>Warning, Caps Lock is ON!</source>
+        <translation>تحذير، مفتاح Caps Lock ممكّن!</translation>
+    </message>
+    <message>
+        <source>Layout</source>
+        <translation>التّخطيط</translation>
+    </message>
+    <message>
+        <source>Login</source>
+        <translation>لِج</translation>
+    </message>
+    <message>
+        <source>Login failed</source>
+        <translation>فشل الولوج</translation>
+    </message>
+    <message>
+        <source>Login succeeded</source>
+        <translation>نجح الولوج</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation>كلمة المرور</translation>
+    </message>
+    <message>
+        <source>Enter your username and password</source>
+        <translation>أدخِل اسم المستخدم وكلمة مروره</translation>
+    </message>
+    <message>
+        <source>Reboot</source>
+        <translation>أعد الإقلاع</translation>
+    </message>
+    <message>
+        <source>Session</source>
+        <translation>الجلسة</translation>
+    </message>
+    <message>
+        <source>Shutdown</source>
+        <translation>أطفئ</translation>
+    </message>
+    <message>
+        <source>User name</source>
+        <translation>اسم المستخدم</translation>
+    </message>
+    <message>
+        <source>Select your user and enter password</source>
+        <translation>اختر مستخدمًا وأدخِل كلمة مروره</translation>
+    </message>
+</context>
+</TS>
diff -Nuar sddm-0.11.0/data/translations/CMakeLists.txt sddm-master/data/translations/CMakeLists.txt
--- sddm-0.11.0/data/translations/CMakeLists.txt	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/translations/CMakeLists.txt	2015-03-08 18:18:48.000000000 +0200
@@ -1,9 +1,11 @@
 set(TRANSLATION_FILES
+    ar.ts
     cs.ts
     de.ts
     et.ts
     fi.ts
     fr.ts
+    hu.ts
     it.ts
     ja.ts
     pl.ts
diff -Nuar sddm-0.11.0/data/translations/hu.ts sddm-master/data/translations/hu.ts
--- sddm-0.11.0/data/translations/hu.ts	1970-01-01 02:00:00.000000000 +0200
+++ sddm-master/data/translations/hu.ts	2015-03-08 18:18:48.000000000 +0200
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="hu">
+<context>
+    <name>TextConstants</name>
+    <message>
+        <source>Welcome to %1</source>
+        <translation>Üdvözöljük - %1</translation>
+    </message>
+    <message>
+        <source>Warning, Caps Lock is ON!</source>
+        <translation>Figyelem: a Caps Lock BE van kapcsolva!</translation>
+    </message>
+    <message>
+        <source>Layout</source>
+        <translation>Nézet</translation>
+    </message>
+    <message>
+        <source>Login</source>
+        <translation>Bejelentkezés</translation>
+    </message>
+    <message>
+        <source>Login failed</source>
+        <translation>Bejelentkezés sikertelen</translation>
+    </message>
+    <message>
+        <source>Login succeeded</source>
+        <translation>Sikeres bejelentkezés</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation>Jelszó</translation>
+    </message>
+    <message>
+        <source>Enter your username and password</source>
+        <translation>Írja be a felhasználónevét és a jelszavát</translation>
+    </message>
+    <message>
+        <source>Reboot</source>
+        <translation>Újraindítás</translation>
+    </message>
+    <message>
+        <source>Session</source>
+        <translation>Munkamenet</translation>
+    </message>
+    <message>
+        <source>Shutdown</source>
+        <translation>Leállítás</translation>
+    </message>
+    <message>
+        <source>User name</source>
+        <translation>Felhasználónév</translation>
+    </message>
+    <message>
+        <source>Select your user and enter password</source>
+        <translation>Válassza ki a felhasználónevét és írja be a jelszavát</translation>
+    </message>
+</context>
+</TS>
diff -Nuar sddm-0.11.0/data/translations/it.ts sddm-master/data/translations/it.ts
--- sddm-0.11.0/data/translations/it.ts	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/translations/it.ts	2015-03-08 18:18:48.000000000 +0200
@@ -21,7 +21,7 @@
     </message>
     <message>
         <source>Login failed</source>
-        <translation>Accesso fallito</translation>
+        <translation>Accesso non riuscito</translation>
     </message>
     <message>
         <source>Login succeeded</source>
diff -Nuar sddm-0.11.0/data/translations/pt_PT.ts sddm-master/data/translations/pt_PT.ts
--- sddm-0.11.0/data/translations/pt_PT.ts	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/translations/pt_PT.ts	2015-03-08 18:18:48.000000000 +0200
@@ -5,11 +5,11 @@
     <name>TextConstants</name>
     <message>
         <source>Welcome to %1</source>
-        <translation>Bem-vindo a %1</translation>
+        <translation>Bem-vindo ao %1</translation>
     </message>
     <message>
         <source>Warning, Caps Lock is ON!</source>
-        <translation>Atenção, Caps Lock está ligada!</translation>
+        <translation>Atenção, Caps Lock está ativo!</translation>
     </message>
     <message>
         <source>Layout</source>
@@ -17,15 +17,15 @@
     </message>
     <message>
         <source>Login</source>
-        <translation>Sessão</translation>
+        <translation>Autenticação</translation>
     </message>
     <message>
         <source>Login failed</source>
-        <translation>A autenticação falhou</translation>
+        <translation>Falha de autenticação</translation>
     </message>
     <message>
         <source>Login succeeded</source>
-        <translation>Autentificação com sucesso</translation>
+        <translation>Autenticação efetuada</translation>
     </message>
     <message>
         <source>Password</source>
@@ -33,7 +33,7 @@
     </message>
     <message>
         <source>Enter your username and password</source>
-        <translation>Escreva o seu nome de utilizador e senha</translation>
+        <translation>Escreva o seu nome de utilizador e a senha</translation>
     </message>
     <message>
         <source>Reboot</source>
diff -Nuar sddm-0.11.0/data/translations/tr.ts sddm-master/data/translations/tr.ts
--- sddm-0.11.0/data/translations/tr.ts	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/data/translations/tr.ts	2015-03-08 18:18:48.000000000 +0200
@@ -5,7 +5,7 @@
     <name>TextConstants</name>
     <message>
         <source>Welcome to %1</source>
-        <translation>Hoşgeldiniz (%1)</translation>
+        <translation>Hoş Geldiniz (%1)</translation>
     </message>
     <message>
         <source>Warning, Caps Lock is ON!</source>
@@ -29,11 +29,11 @@
     </message>
     <message>
         <source>Password</source>
-        <translation>Şifre</translation>
+        <translation>Parola</translation>
     </message>
     <message>
         <source>Enter your username and password</source>
-        <translation>Kullanıcı adınızı ve şifrenizi giriniz</translation>
+        <translation>Kullanıcı adınızı ve parolanızı giriniz</translation>
     </message>
     <message>
         <source>Reboot</source>
@@ -53,7 +53,7 @@
     </message>
     <message>
         <source>Select your user and enter password</source>
-        <translation>Kullanıcınızı seçiniz ve şifrenizi giriniz</translation>
+        <translation>Kullanıcınızı seçiniz ve parolanızı giriniz</translation>
     </message>
 </context>
 </TS>
diff -Nuar sddm-0.11.0/README.md sddm-master/README.md
--- sddm-0.11.0/README.md	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/README.md	2015-03-08 18:18:48.000000000 +0200
@@ -2,7 +2,7 @@
 
 [![Build Status](https://travis-ci.org/sddm/sddm.svg?branch=master)](https://travis-ci.org/sddm/sddm)
 
-SDDM is a modern display manager for X11 aiming to be fast, simple and beatiful. It uses modern technologies like QtQuick, which in turn gives the designer the ability to create smooth, animated user interfaces.
+SDDM is a modern display manager for X11 aiming to be fast, simple and beautiful. It uses modern technologies like QtQuick, which in turn gives the designer the ability to create smooth, animated user interfaces.
 
 SDDM is extremely themeable. We put no restrictions on the user interface design, it is completely up to the designer. We simply provide a few callbacks to the user interface which can be used for authentication, suspend etc. To further ease theme creation we provide some premade components like a textbox, a combox etc.
 
diff -Nuar sddm-0.11.0/src/common/Configuration.h sddm-master/src/common/Configuration.h
--- sddm-0.11.0/src/common/Configuration.h	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/common/Configuration.h	2015-03-08 18:18:48.000000000 +0200
@@ -54,6 +54,7 @@
         // TODO: Not absolutely sure if everything belongs here. Xsessions, VT and probably some more seem universal
         Section(XDisplay,
             Entry(ServerPath,          QString,     _S("/usr/bin/X"),                           _S("X server path"));
+            Entry(XephyrPath,          QString,     _S("/usr/bin/Xephyr"),                      _S("Xephyr path"));
             Entry(XauthPath,           QString,     _S("/usr/bin/xauth"),                       _S("Xauth path"));
             Entry(SessionDir,          QString,     _S("/usr/share/xsessions"),                 _S("Session description directory"));
             Entry(SessionCommand,      QString,     _S(SESSION_COMMAND),                        _S("Xsession script path\n"
diff -Nuar sddm-0.11.0/src/daemon/Display.cpp sddm-master/src/daemon/Display.cpp
--- sddm-0.11.0/src/daemon/Display.cpp	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/Display.cpp	2015-03-08 18:18:48.000000000 +0200
@@ -40,8 +40,8 @@
 #include <unistd.h>
 
 namespace SDDM {
-    Display::Display(const int displayId, const int terminalId, Seat *parent) : QObject(parent),
-        m_displayId(displayId), m_terminalId(terminalId),
+    Display::Display(const int terminalId, Seat *parent) : QObject(parent),
+        m_terminalId(terminalId),
         m_auth(new Auth(this)),
         m_displayServer(new XorgDisplayServer(this)),
         m_seat(parent),
@@ -73,8 +73,8 @@
         stop();
     }
 
-    const int Display::displayId() const {
-        return m_displayId;
+    QString Display::displayId() const {
+        return m_displayServer->display();
     }
 
     const int Display::terminalId() const {
diff -Nuar sddm-0.11.0/src/daemon/Display.h sddm-master/src/daemon/Display.h
--- sddm-0.11.0/src/daemon/Display.h	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/Display.h	2015-03-08 18:18:48.000000000 +0200
@@ -39,10 +39,10 @@
         Q_OBJECT
         Q_DISABLE_COPY(Display)
     public:
-        explicit Display(const int displayId, const int terminalId, Seat *parent);
+        explicit Display(int terminalId, Seat *parent);
         ~Display();
 
-        const int displayId() const;
+        QString displayId() const;
         const int terminalId() const;
 
         const QString &name() const;
@@ -71,7 +71,6 @@
         bool m_relogin { true };
         bool m_started { false };
 
-        int m_displayId { 0 };
         int m_terminalId { 7 };
 
         QString m_passPhrase;
diff -Nuar sddm-0.11.0/src/daemon/Seat.cpp sddm-master/src/daemon/Seat.cpp
--- sddm-0.11.0/src/daemon/Seat.cpp	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/Seat.cpp	2015-03-08 18:18:48.000000000 +0200
@@ -51,36 +51,25 @@
         return m_name;
     }
 
-    void Seat::createDisplay(int displayId, int terminalId) {
+    void Seat::createDisplay(int terminalId) {
         //reload config if needed
         mainConfig.load();
         
-        if (displayId == -1) {
-            // find unused display
-            displayId = findUnused(0, [&](const int number) {
-                bool alreadyExists = m_displayIds.contains(number);
-                if (!alreadyExists)
-                    alreadyExists = XorgDisplayServer::displayExists(number);
-                return alreadyExists;
-            });
-
-            // find unused terminal
+        if (terminalId == -1) {
+                // find unused terminal
             terminalId = findUnused(mainConfig.XDisplay.MinimumVT.get(), [&](const int number) {
                 return m_terminalIds.contains(number);
             });
         }
 
-        // mark display as used
-        m_displayIds << displayId;
-
         // mark terminal as used
         m_terminalIds << terminalId;
 
         // log message
-        qDebug() << "Adding new display" << displayId << "on vt" << terminalId << "...";
+        qDebug() << "Adding new display" << "on vt" << terminalId << "...";
 
         // create a new display
-        Display *display = new Display(displayId, terminalId, this);
+        Display *display = new Display(terminalId, this);
 
         // restart display on stop
         connect(display, SIGNAL(stopped()), this, SLOT(displayStopped()));
@@ -92,26 +81,14 @@
         display->start();
     }
 
-    void Seat::removeDisplay(int displayId) {
-        qDebug() << "Removing display" << displayId << "...";
-
-        // display object
-        Display *display = nullptr;
+    void Seat::removeDisplay(Display* display) {
+        qDebug() << "Removing display" << display->displayId() << "...";
 
-        // find display
-        for (Display *d: m_displays)
-            if (d->displayId() == displayId)
-                display = d;
-
-        // check if found
-        if (display == nullptr)
-            return;
 
         // remove display from list
         m_displays.removeAll(display);
 
         // mark display and terminal ids as unused
-        m_displayIds.removeAll(display->displayId());
         m_terminalIds.removeAll(display->terminalId());
 
         // stop the display
@@ -127,7 +104,7 @@
         Display *display = qobject_cast<Display *>(sender());
 
         // remove display
-        removeDisplay(display->displayId());
+        removeDisplay(display);
 
         // restart otherwise
         if (m_displays.isEmpty())
diff -Nuar sddm-0.11.0/src/daemon/Seat.h sddm-master/src/daemon/Seat.h
--- sddm-0.11.0/src/daemon/Seat.h	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/Seat.h	2015-03-08 18:18:48.000000000 +0200
@@ -34,8 +34,8 @@
         const QString &name() const;
 
     public slots:
-        void createDisplay(int displayId = -1, int terminalId = -1);
-        void removeDisplay(int displayId);
+        void createDisplay(int terminalId = -1);
+        void removeDisplay(SDDM::Display* display);
 
     private slots:
         void displayStopped();
@@ -45,7 +45,6 @@
 
         QList<Display *> m_displays;
         QList<int> m_terminalIds;
-        QList<int> m_displayIds;
     };
 }
 
diff -Nuar sddm-0.11.0/src/daemon/Utils.h sddm-master/src/daemon/Utils.h
--- sddm-0.11.0/src/daemon/Utils.h	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/Utils.h	2015-03-08 18:18:48.000000000 +0200
@@ -21,6 +21,8 @@
 #ifndef SDDM_UTILS_H
 #define SDDM_UTILS_H
 
+#include <random>
+
 namespace SDDM {
 
 inline QString generateName(int length) {
diff -Nuar sddm-0.11.0/src/daemon/XorgDisplayServer.cpp sddm-master/src/daemon/XorgDisplayServer.cpp
--- sddm-0.11.0/src/daemon/XorgDisplayServer.cpp	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/XorgDisplayServer.cpp	2015-03-08 18:18:48.000000000 +0200
@@ -28,6 +28,9 @@
 #include <QDebug>
 #include <QFile>
 #include <QProcess>
+#include <QUuid>
+
+#include <random>
 
 #include <xcb/xcb.h>
 
@@ -36,9 +39,6 @@
 
 namespace SDDM {
     XorgDisplayServer::XorgDisplayServer(Display *parent) : DisplayServer(parent) {
-        // figure out the X11 display
-        m_display = QString(":%1").arg(displayPtr()->displayId());
-
         // get auth directory
         QString authDir = RUNTIME_DIR;
 
@@ -50,7 +50,7 @@
         QDir().mkpath(authDir);
 
         // set auth path
-        m_authPath = QString("%1/%2").arg(authDir).arg(m_display);
+        m_authPath = QString("%1/%2").arg(authDir).arg(QUuid::createUuid().toString());
 
         // generate cookie
         std::random_device rd;
@@ -70,10 +70,6 @@
         stop();
     }
 
-    bool XorgDisplayServer::displayExists(int number) {
-        return QFile(QString("/tmp/.X%1-lock").arg(number)).exists();
-    }
-
     const QString &XorgDisplayServer::display() const {
         return m_display;
     }
@@ -136,44 +132,72 @@
         if (daemonApp->testing()) {
             QStringList args;
             args << m_display << "-ac" << "-br" << "-noreset" << "-screen" << "800x600";
-            process->start("/usr/bin/Xephyr", args);
+            process->start(mainConfig.XDisplay.XephyrPath.get(), args);
+
+
+            // wait for display server to start
+            if (!process->waitForStarted()) {
+                // log message
+                qCritical() << "Failed to start display server process.";
+
+                // return fail
+                return false;
+            }
+            emit started();
         } else {
             // set process environment
             QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
-            env.insert("DISPLAY", m_display);
-            env.insert("XAUTHORITY", m_authPath);
             env.insert("XCURSOR_THEME", mainConfig.Theme.CursorTheme.get());
             process->setProcessEnvironment(env);
 
-            // tell the display server to notify us when we can connect
-            SignalHandler::ignoreSigusr1();
+            //create pipe for communicating with X server
+            //0 == read from X, 1== write to from X
+            int pipeFds[2];
+            if (pipe(pipeFds) != 0) {
+                qCritical("Could not create pipe to start X server");
+            }
 
             // start display server
             QStringList args;
-            args << m_display
-                 << "-auth" << m_authPath
+            args << "-auth" << m_authPath
                  << "-nolisten" << "tcp"
                  << "-background" << "none"
                  << "-noreset"
+                 << "-displayfd" << QString::number(pipeFds[1])
                  << QString("vt%1").arg(displayPtr()->terminalId());
             qDebug() << "Running:"
                      << qPrintable(mainConfig.XDisplay.ServerPath.get())
                      << qPrintable(args.join(" "));
             process->start(mainConfig.XDisplay.ServerPath.get(), args);
-            SignalHandler::initializeSigusr1();
-            connect(DaemonApp::instance()->signalHandler(), SIGNAL(sigusr1Received()), this, SIGNAL(started()));
-        }
 
-        // wait for display server to start
-        if (!process->waitForStarted()) {
-            // log message
-            qCritical() << "Failed to start display server process.";
+            // wait for display server to start
+            if (!process->waitForStarted()) {
+                // log message
+                qCritical() << "Failed to start display server process.";
+
+                // return fail
+                close(pipeFds[0]);
+                return false;
+            }
+
+            QFile readPipe;
+
+            if (!readPipe.open(pipeFds[0], QIODevice::ReadOnly)) {
+                qCritical("Failed to open pipe to start X Server ");
+
+                close(pipeFds[0]);
+                return false;
+            }
+            QByteArray displayNumber = readPipe.readLine();
+            displayNumber.prepend(QByteArray(":"));
+            displayNumber.remove(displayNumber.size() -1, 1); //trim trailing whitespace
+            m_display= displayNumber;
+    
+            // close our pipe
+            close(pipeFds[0]);
 
-            // return fail
-            return false;
-        }
-        if (daemonApp->testing())
             emit started();
+        }
 
         // set flag
         m_started = true;
diff -Nuar sddm-0.11.0/src/daemon/XorgDisplayServer.h sddm-master/src/daemon/XorgDisplayServer.h
--- sddm-0.11.0/src/daemon/XorgDisplayServer.h	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/daemon/XorgDisplayServer.h	2015-03-08 18:18:48.000000000 +0200
@@ -33,8 +33,6 @@
         explicit XorgDisplayServer(Display *parent);
         ~XorgDisplayServer();
 
-        static bool displayExists(int number);
-
         const QString &display() const;
         const QString &authPath() const;
 
diff -Nuar sddm-0.11.0/src/greeter/SessionModel.cpp sddm-master/src/greeter/SessionModel.cpp
--- sddm-0.11.0/src/greeter/SessionModel.cpp	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/greeter/SessionModel.cpp	2015-03-08 18:18:48.000000000 +0200
@@ -57,6 +57,7 @@
                 continue;
             SessionPtr si { new Session { session, "", "", "" } };
             QTextStream in(&inputFile);
+            bool execAllowed = true;
             while (!in.atEnd()) {
                 QString line = in.readLine();
                 if (line.startsWith("Name="))
@@ -65,9 +66,15 @@
                     si->exec = line.mid(5);
                 if (line.startsWith("Comment="))
                     si->comment = line.mid(8);
+                if (line.startsWith("TryExec=")) {
+                    QFileInfo fi(line.mid(8));
+                    if (!fi.exists() || !fi.isExecutable())
+                        execAllowed = false;
+                }
             }
             // add to sessions list
-            d->sessions.push_back(si);
+            if (execAllowed)
+                d->sessions.push_back(si);
             // close file
             inputFile.close();
         }
diff -Nuar sddm-0.11.0/src/helper/backend/PamBackend.cpp sddm-master/src/helper/backend/PamBackend.cpp
--- sddm-0.11.0/src/helper/backend/PamBackend.cpp	2014-11-20 17:47:24.000000000 +0200
+++ sddm-master/src/helper/backend/PamBackend.cpp	2015-03-08 18:18:48.000000000 +0200
@@ -251,7 +251,9 @@
         QProcessEnvironment sessionEnv = m_app->session()->processEnvironment();
         QString display = sessionEnv.value("DISPLAY");
         if (!display.isEmpty()) {
+#ifdef PAM_XDISPLAY
             m_pam->setItem(PAM_XDISPLAY, qPrintable(display));
+#endif
             m_pam->setItem(PAM_TTY, qPrintable(display));
         }
         if (!m_pam->putEnv(sessionEnv)) {
