Starting KWin/Wayland on another virtual terminal

So far when one started KWin/Wayland on a virtual terminal it took over this virtual terminal. This made it difficult to read the debug output and even more difficult to run the complete session through gdb.

The reason for this behavior is that KWin interacts with logind and needs to take session control on the current logind session. This is needed to have logind open the restricted device files like /dev/dri/card0 or the /dev/input/event* files.

Latest KWin master changes the interaction with logind to have it based on XDG_SESSION_ID. In addition changing virtual terminals is now based on logind instead of custom code for switching through ioctl calls.

A side-effect of these changes is that one can start KWin for another logind session. E.g. it’s now possible to create a logind session on virtual terminal 1 and start KWin on virtual terminal 2 for the logind session on virtual terminal 1. KWin automatically switches the virtual terminal when starting up, so one gets the graphical output. This makes it much easier to get to the debug output.

But this also makes it possible to run KWin through gdb by connecting through ssh. Log in to your system through ssh and start kwin_wayland through gdb with XDG_SESSION_ID pointing to the session on your virtual terminal 1.

March Wayland update: ASCII Art rendering

Another busy month, another round of great features being worked on. March featured our Plasma 5.6 release which had lots of last minute (aka bug fixing) focus. We had our sprint at CERN. But of course also new code was added.

One of the features on my TODO list for Plasma 5.7 is the ASCII art output rendering. Mplayer supports that and while that is nice, it’s not really a good solution. It would be way more convenient to have the complete workspace rendered through ASCII art to not have to implement this feature in every application.

So without much further ado I’m happy to announce the caca platform for KWin:

Glxgears running in nested KWin on caca platform
Glxgears running in nested KWin on caca platform

Unfortunately it’s only supported by our QPainter based compositor. Thus to run it, you need to make sure to use KWIN_COMPOSE=Q to pick the QPainter backend (yeah we should improve that to have a better automatic selection). This is the first platform which support both nested and full mode. Thus you can run with –ascii in your normal X session which will open a window, just like our nested X11 platform plugin. The rendering is done through the great caca library.

Lock screen in KWin's caca platform
Lock screen in KWin’s caca platform

What I’m personally impressed about is how small this new platform plugin is. Less than 400 lines of code, great job by libcaca. But it also shows how easy it is to get KWin on a new platform.