The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.
In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
- The name of tty devices is different; put detection into
the CMakeLists and pass that as a define when building
virtual_terminal.cpp -- this means no ifdeffery for the path.
- The name of dri devices is different; FreeBSD just has one.
- need to shuffle some Linux includes behind an ifdef, and some
FreeBSD ones as well
- FreeBSD has no notion of major device numbers anymore, so the
isTty() function can't really tell. Just ignore the check --
I'm assuming the somewhat-standard isatty() doesn't do what
is wanted, since otherwise it would be used.
If we were on e.g. vt 1 and pressed Ctrl+Alt+F1 KWin broke as it
disabled rendering for vt switch and vt switched to vt 1, which
obviously failed.
So let's check whether it's going to switch to the vt we are already
on and ignore surch requests.
This change is motivated by the fact that we need to suspend libinput
before switching the virtual terminal. Also we don't want to take over
libinput if we do not have a VirtualTerminal created - in windowed mode
we don't want libinput to be started. So binding it to the backends which
create the VirtualTerminal makes sense.
The KWin::Application gains a new signal virtualTerminalCreated which is
emitted from VirtualTerminal once it's properly setup. This is used by
Input to create Libinput integration instead of binding it to logind.
Furthermore Libinput gets suspended when the VirtualTerminal reports that
it is no longer active. For re-activation we still just use logind's
session active property.
A new Singleton VirtualTerminal is added. It interacts with Logind to
get the VTNr to take over. To get the signal to release and acquire the
VT we use a signalfd with a QSocketNotifier to monitor for signals. The
used signals must be blocked for all threads prior to startup otherwise
they are delivered to secondary threads causing issues.