Why does kwin_wayland not start?

From time to time I get contacted because kwin_wayland or startplasmacompositor doesn’t work. With this blog post I want to show some of the most common problems and how to diagnose correctly what’s going wrong.

First test nested setup

If you want to try Wayland please always first try the nested setup. This is less complex and if things go wrong easier to diagnose than a maybe frozen tty. So start your normal X session and run a nested KWin:
export $(dbus-launch)
kwin_wayland --xwayland

This should create a black window. If it works you can send windows there, e.g.:
kwrite --platform wayland

When things go wrong

Xwayland missing

KWin terminates and you get the error message:

FATAL ERROR: failed to start Xwayland

This means you don’t have Xwayland installed. It’s a runtime dependency of KWin. Please get in contact with your distribution, they need to fix the packaging 😉

Application doesn’t start

KWin starts fine but the application doesn’t show because of an error message like:

This application failed to start because it could not find or load the Qt platform plugin “wayland”in “”.

Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.

This means QtWayland is not installed. Please install it and try again.

Platform plugin missing

KWin terminates and you get the error message:

FATAL ERROR: could not find a backend

This means that the platform/backend plugin is not installed. KWin supports multiple platforms and distributions put them in multiple packages. For X11 you need e.g. on Debian based systems the package kwin-wayland-backend-x11. For the “real thing” you need: kwin-wayland-backend-drm.

XDG_RUNTIME_DIR not set

KWin terminates and you get the error message:

FATAL ERROR: could not create Wayland server

This means that KWin failed to create the Wayland server socket. The most common reason for this is that your environment does not contain the XDG_RUNTIME_DIR environment variable. This should be created and set by your login system. Please get in contact with your distribution. The debug output should also say something about XDG_RUNTIME_DIR.

Platform fails to load

KWin terminates and you get the error message:

FATAL ERROR: could not instantiate a backend

You hit the jackpot. Something somewhere went horribly wrong. Please activate all KWin related debug categories, run it again and report a bug against KWin – ideally for the platform you used. The debug output hopefully contains more information on why it failed. If not we need to try to look into your specific setup.

Trying on the tty

KWin works fine in the nested setup: awesome. In most cases this means that KWin will also work on the DRM device. Before trying: make sure that you don’t use the NVIDIA proprietary driver, if you do: sorry that’s not yet supported. If you are on Mesa drivers everything should be fine.

Log in to a tty and setup similar to nested setup – I recommend the exit-with-session command line option to have a nice defined setup to exit again:

export $(dbus-launch)
export QT_QPA_PLATFORM=wayland
kwin_wayland --xwayland --exit-with-session=kwrite

Ideally this should turn your screen black, put the mouse cursor into the center of the screen and after a short time show kwrite. You should be able to interact with it and when closing kwrite KWin should terminate. If that all works you are ready to run startplasmacompositor. It will work.

But what if not. This is the tricky situation. The most often problem I have heard is that KWin freezes at this point and gdb shows KWin is in the main event loop. This most likely means that KWin tries to interact with logind DBus API, but your system does not provide this DBus interface. Please get in contact with your distribution on how to get the logind DBus interface installed (this does neither require using systemd nor logind). I would like to handle this better, but I don’t have a system without logind to test. Patches welcome.

Running KWin on the weird systems

Yes one can go crazy and try running KWin on devices like the Nexus 5, Virtual Machines or NVIDIA based systems. Here the experience differs and I myself don’t know exactly what is supported on which hardware and in which setting combination. Best get in contact with us to check what works and if you are interested: please help in adding support for it.

69 Replies to “Why does kwin_wayland not start?”

  1. I got this when trying your first suggestion:

    $ export $(dbus-launch)
    $ kwin_wayland –xwayland
    No backend specified through command line argument, trying auto resolution
    kwin_core: bind OpenGL API failed
    kwin_core: Creating egl surface failed
    kwin_core: Failed to initialize compositing, compositing disabled
    kwin_core: The used windowing system requires compositing
    kwin_core: We are going to quit KWin now as it is broken

    This is on a Debian Sid system and the Compositor system settings are enabled at startup, Rendering backend is OpenGL 3.1 and OpenGL interface is GLX.
    I’m using the nvidia-driver package version 352.79-9 on a GeForce GT 430 card.

    What am I missing and/or doing wrong?

    1. Obviously posted this before realizing I have a ‘weird’ system.
      Feel free to delete my previous comment (and this one).

      OTOH, I wouldn’t mind helping getting it to work on nvidia.

      1. What you could try is whether the quainter based compositor works. That would already be a huge step.

        1. I don’t even know what the quainter based compositor is or how to install/enable it. But if you have instructions on how to do it, I’d be happy to try it.
          As the comment section may not be appropriate/efficient for a ‘debugging’ session, I’ve changed my email address to one I actually check on a regular basis. Feel free to use it if you want.

          Also possibly relevant is that I’m using plasma 5.6 as not all 5.7 packages have been uploaded to sid, but I could upgrade the following packages to 5.7 if that would help:

          bluedevil breeze breeze-cursor-theme kde-cli-tools kde-cli-tools-data kde-config-gtk-style kde-config-screenlocker kde-config-sddm kde-style-breeze kde-style-breeze-qt4 kde-style-oxygen-qt5 kgamma5 khotkeys khotkeys-data kinfocenter kscreen ksysguard ksysguard-data ksysguardd kwayland-integration kwin-common kwin-data kwin-style-breeze kwin-wayland kwin-wayland-backend-x11 kwin-x11 kwrited libkdecorations2-5v5 libkdecorations2private5v5 libkf5libkdepim-data libkf5libkdepim-plugins libkf5libkdepim5 libkf5sysguard-bin libkf5sysguard-data libkscreenlocker5 libksgrd7 libksignalplotter7 libkwin4-effect-builtins1 libkwineffects8 libkwinglutils8 libkwinxrenderutils8 liboxygenstyle5-5 liboxygenstyleconfig5-5 libprocesscore7 libprocessui7 milou oxygen-sounds plasma-integration plasma-pa qml-module-qtquick-controls-styles-breeze systemsettings user-manager

          In the meantime I’m trying to upgrade my driver version to 364 as I’ve understood that should (greatly) improve wayland support.

            1. $ KWIN_COMPOSE=Q
              $ export $(dbus-launch)
              $ kwin_wayland –xwayland
              No backend specified through command line argument, trying auto resolution
              kwin_core: choose config failed
              kwin_core: Creating egl surface failed
              kwin_core: Failed to initialize compositing, compositing disabled
              kwin_core: The used windowing system requires compositing
              kwin_core: We are going to quit KWin now as it is broken

              So “kwin_core: bind OpenGL API failed” has been replaced with “kwin_core: choose config failed”, but it’s otherwise identical.

              Note that on both tries, I do shortly see a window which gets killed immediately.

              1. Upgrading the driver to 364 gave a (slightly) better result:

                $ export $(dbus-launch)
                $ kwin_wayland –xwayland
                No backend specified through command line argument, trying auto resolution
                OpenGL vendor string: NVIDIA Corporation
                OpenGL renderer string: GeForce GT 430/PCIe/SSE2
                OpenGL version string: 3.1.0 NVIDIA 364.19
                OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
                Driver: NVIDIA
                Driver version: 364.19
                GPU class: GF100
                OpenGL version: 3.1
                GLSL version: 1.40
                Linux kernel version: 4.6
                Requires strict binding: no
                GLSL shaders: yes
                Texture NPOT support: yes
                Virtual Machine: no
                kwin_core: Failed to initialize compositing, compositing disabled
                kwin_core: The used windowing system requires compositing
                kwin_core: We are going to quit KWin now as it is broken

                adding “KWIN_COMPOSE=Q” before the other 2 commands gave the exact same output as above.

                1. That actually looks quite good already. Though we unfortunately do not see why KWin failed to initialize compositing. Looks like I need to add more debug output

                  1. Just read through the code and I think it fails in eglInitialize. I’m missing some debug output which should have been there if it succeeded. In the process of adding more debug info.

                  2. Applying the debugging settings from https://blog.martin-graesslin.com/blog/2016/07/why-does-kwin_wayland-not-start/#comment-71360
                    provided some more output:

                    $ export $(dbus-launch)
                    $ kwin_wayland –xwayland
                    No backend specified through command line argument, trying auto resolution
                    kwin_core: KGlobalAcceld inited
                    kwin_core: Forcing EGL native interface for Wayland mode
                    kwin_core: Initializing OpenGL compositing
                    kwin_core: Egl Initialize succeeded
                    kwin_core: EGL version: 1 . 4
                    OpenGL vendor string: NVIDIA Corporation
                    OpenGL renderer string: GeForce GT 430/PCIe/SSE2
                    OpenGL version string: 3.1.0 NVIDIA 364.19
                    OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
                    Driver: NVIDIA
                    Driver version: 364.19
                    GPU class: GF100
                    OpenGL version: 3.1
                    GLSL version: 1.40
                    Linux kernel version: 4.6
                    Requires strict binding: no
                    GLSL shaders: yes
                    Texture NPOT support: yes
                    Virtual Machine: no
                    kwin_core: Creating the OpenGL rendering failed: “Required extension GL_OES_EGL_image not found, disabling compositing”
                    kwin_core: Failed to initialize compositing, compositing disabled
                    kwin_core: The used windowing system requires compositing
                    kwin_core: We are going to quit KWin now as it is broken

                    HTH

                    1. allright, it’s the lack of GL_OES_EGL_image. Hmm not sure whether we really need it or whether there could be a replacement.

                1. It’s getting more interesting with each attempt:

                  $ export KWIN_COMPOSE=Q
                  $ export $(dbus-launch)
                  $ kwin_wayland –xwayland
                  No backend specified through command line argument, trying auto resolution
                  kwin_wayland: an X11 window manager is running on the X11 Display.
                  QSocketNotifier: Invalid socket 12 and type ‘Read’, disabling…
                  KCrash: crashing… crashRecursionCounter = 2
                  KCrash: Application Name = kwin_wayland path = /usr/bin pid = 16789
                  KCrash: Arguments: /usr/bin/kwin_wayland –xwayland
                  KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
                  sock_file=/run/user/1000/kdeinit5__0

      1. What is exactly going on with the NVIDIA proprietary driver?
        What is missing and where is it missing? “it is not supported”…ok…by the driver? or the current kwin code does not support whatever stuff done in a wired way by nvidia?
        Could you clarify?

        1. Nvidia decided to go a different route for Wayland. The code suggested for Weston is still not merged. It is unclear how this will evolve.

        2. NVidia for unclear reasons wanted to use the protocol GLStreams, which gives little or not at all gains compared to the current approach, but requires a very big developer effort: modifying both compositors and existing toolkits. In fact, they could’ve succeed if they’d anticipate in the development from the very beginning, but instead they came when everything is almost ready, and asking: let’s rewrite everything from scratch. Why? Well, nobody knows, I’ve read out of curiosity the discussion, and even though I don’t know the terminology well, but one thing I saw: everything which they want with Streams could either be done with GBM, or can not with either.

          See this article and the linked ones http://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-Wayland-Design-XDC

  2. “Running KWin on the weird systems….. NVIDIA based systems….”

    /me checks the year. 2016.

    Moving on.

      1. Also for those who didn’t notice: there was a fair amount on humor put into that part by causing it weird

  3. Looks like I’m one of the “lucky” ones:
    – Option 1 works, until I dare resizing the embedded Kwin window. Then it shows some artifacts and then it freezes.

    – Option 2 works fine (there is no window to resize, after all

    – Running startplasmacompositor from a VT did show the splash, but then I just got a black screen with a cursor. I could start KRunner and with it other applications, but then at some point the whole system froze, having me need to do a hard-poweroff

    – Trying to start Plasmay (Wayland) from SDDM got me a Plasma, which however crashed pretty quickly. Restarting it Konsole inside that session worked, but it crashed again pretty quickly with this message (with the object number being different each time):

    wl_display@1: error 0: invalid object 174
    The Wayland connection experienced a fatal error (Invalid argument)

    Then at some point my system froze again.

    Is any of this bug-report-worthy?

    1. Depends on how recent your system is. If you have the latest kwayland and plasma 5.7 then all of the that should be reported. If you don’t have the latest kwayland yet I’m quite certain those issues are already fixed

      1. Oh, right, I don’t have the newest Frameworks nor Plasma yet.
        Nevermind, sorry for the noise.

        Will test again when Frameworks 5.24 and Plasma 5.7 hit the Manjaro repos.

  4. Ah, thanks for that, this is something I was intending to try out just recently.
    My device is what you might indeed consider “weird”. It’s an i686 Poulsbo tablet, so while it’s using Mesa DRM drivers, they don’t have hardware acceleration and thus it’s all llvmpipe or friends. Weston works, but I need to specifically tell it to use Pixman. I’m on Gentoo, running systemd with logind, and my ultimate goal is to run Plasma Mobile.

    So, your first test: success, I do get a working KWrite window inside a kwin_wayland window.
    Second test: after running `kwin_wayland –xwayland –exit-with-session=kwrite` I get a black screen with a cursor in the middle. I cannot move the cursor, although if I claw at the screen enough it sometimes turns into an “I” shaped cursor. If I switch to VT2 and run `kwrite –platform wayland`, it seems to show success (“Using Wayland-EGL”), but when I switch back to the first VT, it… well, it doesn’t actually refresh the screen, I still see the contents of VT2, just without the cursor blinking. So I have to do a “kill -INT `pidof kwin_wayland`” to get the VT back.

    Looks like it might a case of a missing platform plugin or something weird with KScreen. Here’s the stderr of a clean attempt to launch kwin_wayland as per above, but without starting an extra kwrite (“QSocketNotifier” and later lines appear after the kill): https://bpaste.net/raw/5805739ee9e9
    I do have the kwayland-integration package installed.

    1. Oh that’s a very interesting setup. Could you enable more debug output? What could also help is enforcing qpainter compositing as KWin still ignores llvmpipe.

            1. Not sure. I think it wouldn’t help much as we don’t have the hardware to properly investigate.

              1. Wouldn’t it be possible to try and simulate that by simply not having a video card driver other than llvmpipe built into Mesa? Or is it really a kernel driver issue? In which case, wouldn’t that mean it should be filed as a bug against the kernel or such?

                1. the pageFlip is in the drm layer so after OpenGL/llvmpipe. For whether that’s a problem with kernel driver: I don’t have enough information. It might also be an error in our code. This is very difficult to say without the hardware in question to properly investigate.

    1. Those from KWin could we as have control. The problem is more that we often don’t know what was the cause. Like calling to start xwayland: we know it failed, but not that it’s not installed. Or the runtime dir problem: all we see is that it failed

      1. Could we add something like “Check if it is installed.” or “Maybe you forgot to install it?” to the xwayland launch error, though? There’s a trend in error messages (say: in compilers) to provide a helping of useful suggestions with your failure.

        1. That’s distros job in my opinion. We set the runtime dependency. It’s something which will be resolved once all distros have fixed their packaging.

          1. Right, unless something goes wrong, and there’s a bunch of thing which could go wrong.

            GTK3 devs probably assumes the same, “it’s job of distros”, so when recently on upgrade my input method stopped working without even a warning, it took me one bug report and 1.5 weeks to find the reason. Turned out, GTK3 for whatever reason caches existing IMs, and ignores everything not mentioned in cache. And the caching command just didn’t run for upgrade, probably because of some weird conflict of latest g++ library and the one required by some packages (in fact, after upgrade even Xorg didn’t run, but I figured it out and fixed).

            This is the real world case, and that didn’t even matter that distro packagers considered the cache creation. Just something gone wrong.

  5. To me wayland does not even start with Plasma 5.7.1 and KF 5.24.

    wayland-errors gives:
    (kwin_wayland:1860): Gtk-WARNING **: cannot open display:
    startplasmacompositor: Shutting down…
    xprop: unable to open display ”
    xprop: unable to open display ”
    startplasmacompositor: Done.

  6. Another interesting setup, which fails when just copy-pasting your commands above: I am running a fully updated Fedora 24 [1], logged in to a gnome wayland session. On a gnome x11 session everything works fine.

    1. Running kwin_wayland from another gui session:
    `export $(dbus-launch)`
    `kwin_wayland –xwayland`
    fails to show a window with black background. Error message:

    unable to lock lockfile /run/user/[uid]/wayland-0.lock, maybe another compositor is running
    _XSERVTransSocketUNIXCreateListener: …SocketCreateListener() failed
    _XSERVTransMakeAllCOTSServerListeners: server already running

    kwin_wayland doesn’t exit though, it just keeps the terminal occupied. When pressing Ctrl+C I get a segmentation violation crash in kwin_wayland: “kwin_wayland[28160]: segfault at 20 ip 00007f5ba9aa8952 sp 00007fff9f538378 error 4 in libwayland-server.so.0.1.0[7f5ba9a9d000+10000]”

    Workaround #1:
    Just use a x11 session, not a wayland session, to test kwin_wayland. Works fine for me on Fedora 24.

    Workaround #2:
    Run `kwin_wayland –xwayland –windowed –socket wayland-1` instead of the command above.
    To make windows run inside this nested kwin_wayland one needs to
    `export WAYLAND_DISPLAY=wayland-1`
    before running
    `kwrite –platform wayland`

    2. Running kwin_wayland on a tty:
    “`
    export $(dbus-launch)
    export QT_QPA_PLATFORM=wayland
    kwin_wayland –xwayland –exit-with-session=kwrite
    “`
    fails but freezes the screen on all ttys until gdm is restarted (which probably is a bug in gdm, but I’m not sure). Probably the trigger cause is the same as above.

    Workaround:
    Don’t have another wayland compositor running on the same user name.

    In case you’re interested in crashes etc., I’m willing to use gdb or valgrind. Just tell me what to do.

    [0] https://blog.martin-graesslin.com/blog/2016/07/why-does-kwin_wayland-not-start/
    [1] with kwin 5.6.5, kf5 5.24.0, kde applications (dolphin, kwrite, …) 16.04.3, qt5 5.6.1, mesa 12.0.1, kernel 4.6.4

    1. ah running in a wayland session requires adding another argument: –socket=wayland-1

      Otherwise KWin tries to use wayland-0 and fails. Also from testing it looks like KWin has problems with starting a working Xwayland in a nested setup with the OpenGL compositor. You might need to use KWIN_COMPOSE=Q

  7. Martin, what’s your preferred distribution for testing/running/developing KWin/Wayland? I’ve been fond of Fedora myself, but also have been tinkering with Arch Linux lately and love it even more.

    Thank you.

  8. Hi

    I was able to run nested session (with kwrite inside) – like you described. I was able to interact with kwrite without any problems – I wrote some word in this editor. OK. I took care other things and forgot for a moment about Wayland session. When I back to Wayland sessions I got locked screen (sddm like). Here I experienced some wired problem with handle of keyboard. I mean in password field cursor was blinking, but I wasn’t able to type any letter, only digits and other characters like colon, dot, slash, etc. Before I didn’t press Numlock key. Pressing this key nothing changed, still I wasn’t able unlock session. Full output from kwin_kwayland was following:

    $ kwin_wayland –xwayland
    No backend specified through command line argument, trying auto resolution
    kglobalaccel-runtime: Failed to register service org.kde.kglobalaccel
    OpenGL vendor string: Intel Open Source Technology Center
    OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)
    OpenGL version string: 4.3 (Core Profile) Mesa 12.0.1
    OpenGL shading language version string: 4.30
    Driver: Intel
    GPU class: Unknown
    OpenGL version: 4.3
    GLSL version: 4.30
    Mesa version: 12.0.1
    Linux kernel version: 4.6.3
    Requires strict binding: no
    GLSL shaders: yes
    Texture NPOT support: yes
    Virtual Machine: no
    libkwinglutils: Update of color profiles failed
    _XSERVTransSocketUNIXCreateListener: …SocketCreateListener() failed
    _XSERVTransMakeAllCOTSServerListeners: server already running
    glamor: EGL version 1.4 (DRI2):
    X-Server started on display :1
    Configuring Lock Action
    file:///usr/share/kwin/virtualkeyboard/main.qml:21:1: module “QtQuick.VirtualKeyboard” is not installed
    import QtQuick.VirtualKeyboard 2.1
    ^
    file:///usr/share/kwin/virtualkeyboard/main-enterprise.qml:21:1: module “QtQuick.Enterprise.VirtualKeyboard” is not installed
    import QtQuick.Enterprise.VirtualKeyboard 2.0
    ^
    Session path: “/org/freedesktop/login1/session/c2”

    lock called
    QObject::connect: invalid null parameter
    Using Wayland-EGL
    file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/InfoPane.qml:54:22: Unable to assign [undefined] to int
    file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/lockscreen/MainBlock.qml:42: TypeError: Cannot read property ‘Locked’ of undefined
    file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/system-log-out
    file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/system-switch-user

    My system based on the newest Plasma (5.7.1) and KFrameworks 5.24.

    1. That’s a problem I have never heard of – for me lock screen is always working. Maybe a modifiers was hold?

      1. The most likely you are right. I wasn’t able to reproduce this behavior.
        Anyway I observed another issue. After starting kwrite I clicked in its main menu and moved mouse cursor through all menus. All was OK. After that I moved window and I did the same. Unfortunately all popup menus were placed in previous position of main menu, not current.

  9. Tested nested kwin_wayland on Mageia 6 (Plasma 5.7.1, Frameworks 5.24): the kwin window opens without errors, but when I tried launching kwrite/konsole in it, the window remained black: however, the mouse cursor changed as I moved it, as if the application was there, only invisible, and I’m pretty sure I could interact with it (didn’t manage to save a text file blindly though)

      1. Kwin_wayland output:
        No backend specified through command line argument, trying auto resolution
        OpenGL vendor string: Intel Open Source Technology Center
        OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile
        OpenGL version string: 3.3 (Core Profile) Mesa 12.0.1
        OpenGL shading language version string: 3.30
        Driver: Intel
        GPU class: SandyBridge
        OpenGL version: 3.3
        GLSL version: 3.30
        Mesa version: 12.0.1
        Linux kernel version: 4.7
        Requires strict binding: no
        GLSL shaders: yes
        Texture NPOT support: yes
        Virtual Machine: no
        _XSERVTransSocketUNIXCreateListener: …SocketCreateListener() failed
        _XSERVTransMakeAllCOTSServerListeners: server already running
        glamor: EGL version 1.4 (DRI2):
        X-Server started on display :1
        Configuring Lock Action
        file:///usr/share/kwin/virtualkeyboard/main.qml:21:1: module “QtQuick.VirtualKeyboard” is not installed
        import QtQuick.VirtualKeyboard 2.1
        ^
        file:///usr/share/kwin/virtualkeyboard/main-enterprise.qml:21:1: module “QtQuick.Enterprise.VirtualKeyboard” is not installed
        import QtQuick.Enterprise.VirtualKeyboard 2.0
        ^
        Session path: “/org/freedesktop/login1/session/c2”
        QObject::connect: invalid null parameter
        QObject::connect: invalid null parameter
        Setting the name of 0x262cb90 to “org.kde.ActivityManager.Resources.Scoring”
        Creating directory: “/home/davide/.local/share/kactivitymanagerd/resources/”
        KActivities: Database connection: “kactivities_db_resources_140023550953472_readwrite”
        query_only: QVariant(qlonglong, 0)
        journal_mode: QVariant(QString, “wal”)
        wal_autocheckpoint: QVariant(qlonglong, 100)
        synchronous: QVariant(qlonglong, 1)
        Setting the name of 0x262fb40 to “org.kde.ActivityManager.ActivityTemplates”
        Setting the name of 0x2674210 to “org.kde.ActivityManager.RunApplication”
        Service started, version: 7.0.0
        Cleaning up…

        kwrite output:
        QSocketNotifier: Can only be used with threads started with QThread
        QObject::connect: invalid null parameter
        Using Wayland-EGL

        After launching kwrite, I can terminate it correctly by pressing Ctrl+Q in the window

    1. Testing Mageia 6, I experienced the same problem. I tested it on a bit older platform that previously (check my earlier post in this forum).
      Need to mention that Mageia uses Qt-5.6.1. Maybe this is matter.
      Installed Wayland packages are following:
      lib64wayland-egl1-devel-12.0.1-3.mga6
      lib64kf5wayland5-5.24.0-1.mga6
      qtwayland5-5.6.1-2.mga6
      lib64gstwayland1.0_0-1.8.2-1.mga6
      x11-server-xwayland-1.18.3-15.mga6
      lib64wayland-devel-1.11.0-1.mga6
      kwin-wayland-5.7.1-4.mga6
      lib64wayland-egl1-12.0.1-3.mga6
      wayland-protocols-devel-1.4-1.mga6
      lib64wayland-server0-1.11.0-1.mga6
      lib64wayland-cursor0-1.11.0-1.mga6
      kwayland-5.24.0-1.mga6
      kwayland-integration-5.7.1-1.mga6
      wayland-tools-1.11.0-1.mga6
      lib64wayland-client0-1.11.0-1.mga6
      lib64qt5waylandclient5-5.6.1-2.mga6

      Full output is following:
      $ kwin_wayland –xwayland
      No backend specified through command line argument, trying auto resolution
      OpenGL vendor string: Intel Open Source Technology Center
      OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile
      OpenGL version string: 3.0 Mesa 12.0.1
      OpenGL shading language version string: 1.30
      Driver: Intel
      GPU class: SandyBridge
      OpenGL version: 3.0
      GLSL version: 1.30
      Mesa version: 12.0.1
      Linux kernel version: 4.7
      Requires strict binding: no
      GLSL shaders: yes
      Texture NPOT support: yes
      Virtual Machine: no
      _XSERVTransSocketUNIXCreateListener: …SocketCreateListener() failed
      _XSERVTransMakeAllCOTSServerListeners: server already running
      glamor: EGL version 1.4 (DRI2):
      X-Server started on display :1
      Configuring Lock Action
      file:///usr/share/kwin/virtualkeyboard/main.qml:21:1: module “QtQuick.VirtualKeyboard” is not installed
      import QtQuick.VirtualKeyboard 2.1
      ^
      file:///usr/share/kwin/virtualkeyboard/main-enterprise.qml:21:1: module “QtQuick.Enterprise.VirtualKeyboard” is not installed
      import QtQuick.Enterprise.VirtualKeyboard 2.0
      ^
      Session path: “/org/freedesktop/login1/session/c2”
      QObject::connect: invalid null parameter
      libkwinglutils: Update of color profiles failed
      QObject::connect: invalid null parameter
      Setting the name of 0x1345780 to “org.kde.ActivityManager.Resources.Scoring”
      Creating directory: “/home/piotrm/.local/share/kactivitymanagerd/resources/”
      KActivities: Database connection: “kactivities_db_resources_139953812350976_readwrite”
      query_only: QVariant(qlonglong, 0)
      journal_mode: QVariant(QString, “wal”)
      wal_autocheckpoint: QVariant(qlonglong, 100)
      synchronous: QVariant(qlonglong, 1)
      Setting the name of 0x1377750 to “org.kde.ActivityManager.VirtualDesktopSwitch”
      Setting the name of 0x13b3970 to “org.kde.ActivityManager.RunApplication”
      Setting the name of 0x1341450 to “org.kde.ActivityManager.ActivityTemplates”
      Service started, version: 7.0.0
      Cleaning up…
      Module ‘org.kde.kwin.decoration’ does not contain a module identifier directive – it cannot be protected from external registrations.
      lock called
      QObject::connect: invalid null parameter
      Using Wayland-EGL
      file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/lockscreen/MainBlock.qml:42: TypeError: Cannot read property ‘Locked’ of undefined
      file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/user-identity
      file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/system-log-out
      file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/UserDelegate.qml:82:9: QML Image: Cannot open: file:///usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/system-switch-user

      1. I tested also nested wayland session in the KaOS distribution (up-to-dated) on SandyBridge platform with the same result as in Mageia 6.
        Different were only Qt in version 5.7.0 and used older Mesa version (11.2.2). Intel drivers (xf86-video-intel) was: 2.99.917.8-1 (in Mageia 6 it was: 2.99.917-26).
        On SkyLake platform I use driver from git in version: 2.99.917+676+g26f8ab5-1.

        Output for KaOS please find below:
        OpenGL vendor string: Intel Open Source Technology Center
        OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile
        OpenGL version string: 3.3 (Core Profile) Mesa 11.2.2
        OpenGL shading language version string: 3.30
        Driver: Intel
        GPU class: SandyBridge
        OpenGL version: 3.3
        GLSL version: 3.30
        Mesa version: 11.2.2
        Linux kernel version: 4.7
        Requires strict binding: no
        GLSL shaders: yes
        Texture NPOT support: yes
        Virtual Machine: no
        _XSERVTransSocketUNIXCreateListener: …SocketCreateListener() failed
        _XSERVTransMakeAllCOTSServerListeners: server already running
        glamor: EGL version 1.4 (DRI2):
        X-Server started on display :1
        Configuring Lock Action
        libkwinglutils: Update of color profiles failed
        Session path: “/org/freedesktop/login1/session/_32”
        Service started, version: 7.0.0

        1. I’m not able to detect a pattern for your system. Maybe it’s caused by having color correction enabled, maybe because of using OpenGL core profile (though one of your debug outputs doesn’t show it).

  10. Issues found in not nested session.

    $ kwin_wayland –xwayland –exit-with-session=kwrite
    1. Double click on title bar does nothing. I mean window is not maximized. After that clicking in any pop-up menu from main menu makes that it is shown at the position/height of title bar (not main menu as I expected).

    $ startplasmacompositor
    1. plasmashell crashed. In output I have received (I put only errors):
    Using Wayland-EGL

    file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Panel.qml:80: TypeError: Cannot read property ‘formFactor’ of null

    file:///usr/share/plasma/plasmoids/org.kde.plasma.systemloadviewer/contents/ui/SystemLoadViewer.qml:246: TypeError: Cannot read property ‘value’ of undefined

    file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/ToolTipDelegate.qml:41: TypeError: Cannot read property ‘length’ of undefined
    file:///usr/lib/qt/qml/QtQuick/Controls/Button.qml:100: TypeError: Cannot read property of null
    file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/ToolTipDelegate.qml:83: TypeError: Cannot read property ‘DesktopEntry’ of undefined

    file:///usr/share/plasma/plasmoids/org.kde.plasma.systemtray/contents/ui/main.qml:29: TypeError: Cannot read property ‘Layout’ of null

    KCrash: Attempting to start /usr/bin/plasmashell from kdeinit
    KCrash: Application ‘plasmashell’ crashing…
    KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
    QSocketNotifier: Invalid socket 9 and type ‘Read’, disabling…

    In taskbar I have following extra icons for: clementine, pamac-tray (gtk+ and not working in X11 session), weather widget, system load viewer.
    Plasmoids on desktop: CpuLoadMonitor, NetworkMonitor, LoadDisk I/O Monitor, ThermalMonitor

    2. No wallpaper on desktop (black screen). Maybe was caused by plasmashell crashed.
    3. Everything was run on first desktop (I have two, where one application placed on this desktop). I was able to move window on second (black) desktop.
    4. RMB menu invoked in KWrite and Konsole window was always shown in the same position, but in TreeView it works correctly (tested with Project and Documents view in KDevelop). Anyway in processes view (invoking by Ctrl+Esc) RMB menu was shown always in the same position.
    5. In systemsetting window, when I move mouse cursor over the icons they flicker. I mean current row of icons.

    All windows looked good. I didn’t notice any differences (compared to X11 session).
    Previously I forgot mention. I have also Qt-5.7.0 and KF are built with this Qt.

    1. To be clear above refers to SkyLake platform:
      OpenGL vendor string: Intel Open Source Technology Center
      OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)
      OpenGL version string: 4.3 (Core Profile) Mesa 12.0.1
      OpenGL shading language version string: 4.30
      Driver: Intel
      GPU class: Unknown
      OpenGL version: 4.3
      GLSL version: 4.30
      Mesa version: 12.0.1
      Linux kernel version: 4.6.4
      Requires strict binding: no
      GLSL shaders: yes
      Texture NPOT support: yes
      Virtual Machine: no
      glamor: EGL version 1.4 (DRI2):

      xf86-video-intel in version: 1:2.99.917+676+g26f8ab5-1
      Qt-5.7.0, Plasma 5.7.1, KFrameworks 5.24 (built with Qt-5.7.0)
      xorg-server-xwayland: 1.18.3-3
      wayland-1.11.0-1, wayland-protocols-1.4-1

  11. Hello

    I’m running Gentoo without systemd, but I have elogind.
    (also, drm ADM GPU, 4.6.4 kernel, 5.7.0 Qt, 5.7.1 plasma, 5.24.0 frameworks)

    Can you elaborate on logind DBus API?
    Is this part of dbus? The only options with systemd/logind in dbus configure are
    > –enable-systemd
    > –with-systemdsystemunitdir=DIR
    > –with-systemduserunitdir=DIR
    The second option is set by build system. (I also tried setting third one and it didn’t help)

    kwin_wayland –xwayland – opens black window when run from X11 Plasma.
    I can also load konsole to DISPLAY=:1 opened by kwin_wayland

    kwin_wayland –xwayland –exit-with-session=konsole – fails to start
    > X-Server started on display :1
    > kf5.kcoreaddons.kaboutdata: Could not initialize the equivalent properties of Q*Application: no instance (yet) existing.
    > Configuring Lock Action
    > file:///usr/share/kwin/virtualkeyboard/main.qml:21:1: module “QtQuick.VirtualKeyboard” is not installed
    > import QtQuick.VirtualKeyboard 2.1
    > ^
    > file:///usr/share/kwin/virtualkeyboard/main-enterprise.qml:21:1: module “QtQuick.Enterprise.VirtualKeyboard” is not installed
    > import QtQuick.Enterprise.VirtualKeyboard 2.0
    > ^
    > QSocketNotifier: Invalid socket 29 with type Read, disabling…
    > The session is not registered: “PID 29080 does not belong to any known session”
    > QObject::connect: invalid null parameter
    > QObject::connect: invalid null parameter
    > The Wayland connection broke. Did the Wayland compositor die?
    > The Wayland connection broke. Did the Wayland compositor die?
    > Failed to create display (No such file or directory)

    kwin_wayland –xwayland –libinput from tty freezes in eventloop in 3 threads.
    (this one was also tested with git versions of Qt, frameworks and plasma)

    1. One cannot start konsole with the exit with session argument. Concerning elogind: sorry, no idea best ask your distribution

  12. Well, first of all, for the second test
    kwin_wayland –xwayland –exit-with-session=kate
    works fine and reports wayland windowing system.

    As for elogind
    Actually, I just found that D-Bus was failing to start elogind. But a fix (in org.freedesktop.login1.service conf) for it was discussed in elogind issues trackes. With it I now get
    dbus[2213]: [system] Activating service name=’org.freedesktop.login1′ (using servicehelper)
    dbus[2213]: [system] Successfully activated service ‘org.freedesktop.login1’

    I looked for all login1 mentions in kwin sources and according to qdbusviewer
    org.freedesktop.login1 is available
    org/freedesktop/login1 is available
    org/freedesktop/login1 has org.freedesktop.login1.Manager
    org/freedesktop/login1/seat/seat0 has org.freedesktop.login1.Seat
    org/freedesktop/login1/session/ does NOT have .Session in it

    So, is it broken?

    On different note, while
    kwin_wayland –xwayland –libinput –drm –exit-with-session=kate
    and
    kwin_wayland –xwayland –libinput –framebuffer –exit-with-session=kate
    don’t print anything at all when run from tty,
    kwin_wayland –xwayland –libinput –virtual –exit-with-session=kate
    prints a lot of stuff. Does it work differently? Does it bypass login1?
    http://pastebin.com/9R6h4G9Q

    It clearly says
    X-Server started on display :0
    Service started, version: 7.0.0
    And I can open X11 apps to :0. Though, I don’t know where I can look at them.

    1. Yeah virtual is different and does not need logind. We only need logind for opening privileged devices like input and drm. Both are not needed in the virtual case.

      1. And with 3rd fix
        cat /etc/pam.d/system-login
        session optional pam_elogind.so
        I was able to launch kwin_wayland both from sddm and tty.

        It works pretty much the same as on KDE Neon (artefacting all over).
        Except for session locking (elogind part).

  13. Thank you so much for writing this.
    It would be great to put it in the KDE wiki for wayland.
    I was looking for info like this for some time as Ive never managed to start KDE with wayland even though I have been trying for some time.

    Lets see if I can get it to work now.

  14. No backend specified through command line argument, trying auto resolution
    kglobalaccel-runtime: Failed to register service org.kde.kglobalaccel
    kwin_core: Init of kglobalaccel failed
    kwin_core: Forcing EGL native interface for Wayland mode
    kwin_core: Initializing OpenGL compositing
    kwin_core: Egl Initialize succeeded
    kwin_core: EGL version: 1 . 4
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: GeForce GTX 980 Ti/PCIe/SSE2
    OpenGL version string: 3.1.0 NVIDIA 367.35
    OpenGL shading language version string: 1.40 NVIDIA via Cg compiler
    Driver: NVIDIA
    Driver version: 367.35
    GPU class: Unknown
    OpenGL version: 3.1
    GLSL version: 1.40
    Linux kernel version: 4.6.4
    Requires strict binding: no
    GLSL shaders: yes
    Texture NPOT support: yes
    Virtual Machine: no
    kwin_core: Creating the OpenGL rendering failed: “Required extension GL_OES_EGL_image not found, disabling compositing”
    kwin_core: Failed to initialize compositing, compositing disabled
    kwin_core: The used windowing system requires compositing
    kwin_core: We are going to quit KWin now as it is broken

    i was wondering if there is a way to get kwin to start through weston? i can get weston working but not kde-wayland…

  15. kept an eye on kde and wayland for some time now. Unfortunately there is one thing that keeps me from giving a peoper ride. I am on a setup with kde pretty up to date, few days behind the git, kernel 4.7.0, qt 5.7.1

    [16:46:42 drFaustroll@circassia:~]: rpm -qa | grep -i wayland
    xorg-x11-server-wayland-7.6_1.18.4-1.1.x86_64
    kwayland-integration-5.7.90git~20160712T101344~626c72b-14.2.x86_64
    wayland-devel-1.11.0-1.3.x86_64
    libqt5-qtwayland-5.7.1-1.1.x86_64
    libQt5WaylandCompositor5-5.7.1-1.1.x86_64
    kwayland-5.21.0git.20160803T114525~2617265-9.1.x86_64
    libgstwayland-1_0-0-1.8.2-124.1.x86_64
    libwayland-egl-devel-12.0.1-141.1.x86_64
    libwayland-client0-1.11.0-1.3.x86_64
    plasma5-session-wayland-5.7.0-1.1.noarch
    libwayland-egl1-12.0.1-141.1.x86_64
    libQt5WaylandClient5-5.7.1-1.1.x86_64
    libwayland-cursor0-1.11.0-1.3.x86_64
    libwayland-server0-1.11.0-1.3.x86_64

    I use kwallet with a gpg backend and pinentry-qt window will not want to apper in the wayland desktop… seems to be somewhere in the curses version since I get the time out message from kwallet.
    pinentry-0.9.7-3.4.x86_64
    pinentry-qt5-0.9.7-3.4.x86_64
    signon-kwallet-extension-15.04.0-3.2.x86_64
    kwalletd5-5.25.0git.20160724T133134~8cf7300-2.2.x86_64
    kwallet-tools-5.25.0git.20160724T133134~8cf7300-2.2.x86_64
    pam_kwallet-0.0.1git.1454233429.d749c2d-31.1.x86_64
    libkwalletbackend5-5-5.25.0git.20160724T133134~8cf7300-2.2.x86_64

    A

    1. Hi A,

      unfortunately, gnupg still doesn’t have a wayland pinentry client (as far as I understand, the Qt-version uses the Xcb plugin in order to place the window properly and take the focus). So in order to get it work with wayland, pinentry will run in XWayland. Now the problem here is, that somehow it doesn’t know the X display (I’m not sure if there is a hacked “:0” ;)). My “solution” is to put
      display :1
      into $HOME/.gnupg/gpg-agent.conf
      Of course if some day the XWayland display is no longer :1, then it won’t work again :/

      I hope this helps!
      Have fun,
      D

Comments are closed.