This simplifies focus related logic a bit. Instead of differentiating
between wayland and internal window focus, simply maintain window focus
that works both with regular wayland windows as well as the ones created
by kwin.
The main motivation behind this change is to prepare input abstractions
for virtual input devices so the wl_seat can properly advertise caps or
the cursor getting properly mapped/unmapped when a fake pointer is
added/removed on a system without a hardware mouse connected.
With this, there are three abstractions - InputDevice, InputBackend, and
InputRedirection.
An InputDevice represents an input device such as a mouse, a keyboard, a
tablet, etc. The InputBackend class notifies the InputRedirection about
(dis-)connected devices. The InputRedirection manages the input devices.
Such design allows to unify the event flow for real and virtual input
devices.
There can be several input backends active. For example, the libinput
backend and an input backend that provides virtual input devices, e.g.
libeis or org_kde_kwin_fake_input.
InputDeviceHandler keeps track of which client has focus, and whether
the decoration or main window has focus.
Should the decoration get destroyed whilst the decoration has focus we
don't update correctly. This can happen when
"BorderlessMaximizedWindows" is set, or if you use key presses whilst
above the decoration.
cleanupDecoration (which is an odd name) is called whenever a decoration
gains or loses focus. Here we can connect for the decoration destruction
and force a focus change.
BUG: 411884
API-wise it's odd to require absolute position with relative pointer
moves.
This cleans up some of InputRedirection code by making it simply forward
pointer input events from input devices to the pointer input device
handler, which knows better what to do with the delta value.
The pointer input device handler will compute the absolute position based
on the specified delta value, but it could also do something else, e.g.
not move the pointer at all if it's locked, etc.
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.
This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.
We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.