Plasma/Wayland: Difference between revisions

From KDE Community Wiki
(Proposed fixes)
Line 64: Line 64:
Since we want to support both, X11 and Wayland with the same binaries, we need to decide at runtime whether or not to call X11-specific functions. We need to guard these calls into X11 libraries as the application will otherwise crash and do something different for non-X11.
Since we want to support both, X11 and Wayland with the same binaries, we need to decide at runtime whether or not to call X11-specific functions. We need to guard these calls into X11 libraries as the application will otherwise crash and do something different for non-X11.


#include <QX11Info>
    #include <QX11Info>
    // [...]
     if (QX11Info::isPlatformX11()) {
     if (QX11Info::isPlatformX11()) {
         // You can safely call into X11 libraries here
         // You can safely call into X11 libraries here

Revision as of 00:15, 23 July 2014

On this page, we're collecting tips and tricks to make Plasma work on Wayland:

Build instructions

We recommend following this guide to install the Wayland stack, including the QtWayland module

Generic, but more detailed build instructions for Wayland / Weston, including underlying stack can be found at: http://wayland.freedesktop.org/building.html

Create a wl-env script somewhere in your $PATH, looking like this (adjust WLD to your wayland installation path):

WLD=/home/sebas/kf5/wayland/install
LD_LIBRARY_PATH=$WLD/lib
PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
ACLOCAL="aclocal -I $WLD/share/aclocal"
export YACC=bison
# This is needed for now, as kscreen will otherwise pick the XRandR backend -- and crash
export KSCREEN_BACKEND=fake

export WLD LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL YACC

if test -z "${XDG_RUNTIME_DIR}"; then
    export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
    if ! test -d "${XDG_RUNTIME_DIR}"; then
        mkdir "${XDG_RUNTIME_DIR}"
        chmod 0700 "${XDG_RUNTIME_DIR}"
    fi
fi

Running KF5 applications under Wayland

Inside an existing X session

weston

starts a new window under your X server with Weston running inside it.


Standalone

From a hard console / virtual terminal:

kf5-env
wl-env
export $(dbus-launch)
weston-launch
kwrite -platform wayland

kf5-env is a script setting up the locations, such as QTDIR, plugin path, etc. for your kf5.


Issues

The following contains a list of issues found when trying to run Plasma or KF5-based software in general under Wayland.

  • kdeinit5 exits due to missing DISPLAY
  • kded5 just hangs there when started
  • Oxygen style works in windowed mode, falls back to Fusion in standalone
  • File open dialog unable to reach klauncher
  • After resizing a window, it's not immediately repainted over the new covering area
  • Icons are missing under Wayland (check with "systemsettings5 -platform wayland", for example)
  • KScreen has no Wayland backend, calls into KScreen will fail (workaround to make it at least not crash is
export KSCREEN_BACKEND=fake
  • Font Management KCM crashes when rendering previews, patch to make it not crash (but also not preview fonts) is in git in plasma-desktop[sebas/wayland]


Fixing problems

X11-specific bits

Since we want to support both, X11 and Wayland with the same binaries, we need to decide at runtime whether or not to call X11-specific functions. We need to guard these calls into X11 libraries as the application will otherwise crash and do something different for non-X11.

    #include <QX11Info>
    // [...]
    if (QX11Info::isPlatformX11()) {
        // You can safely call into X11 libraries here
    } else {
        // Do something smart for non-X11 platforms here
    }