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.

6 Replies to “Starting KWin/Wayland on another virtual terminal”

  1. slightly off topic…

    with the latest kwin/plasma-workspace and kf5.19 the fonts in wayland session are much larger than in x11 one (i had to go from 10pt to 8pt; running on a simple 1024×600 netbook). can this be unified somehow?

    1. I have seen this myself, but unfortunately I have no idea. It’s probably something in QtWayland.

      1. also, the ‘start menu’, although being rendered much faster with wayland, has a small bug: when i launch it first time and start typing, the first letter is typed two times (so i get kkonsole instead of konsole). this happens only in wayland session (reproduces everytime)

  2. Speaking of KWin and Wayland, is there any up-to-date guide anywhere for running it to try it out? The stuff I’ve seen has usually been outdated and/or managed to crash on my system.

Comments are closed.