subsurfaceTreeChanged is emitted on every damage event. This makes it
very noisy and the model constantly resets. This makes it impossible to
expand the tree (as it resets immediately after).
SubSurfaceMonitor gives us more granular signals whilst handling the
recursive aspect.
Also there are no unmanaged windows that are wayland surfaces, so they
are simplified.
Edge::handle calls showOnScreenEdge, which (on wayland) eventually calls internalShow, which eventually calls ScreenEdges::reserve, which destroys the same edge.
When showScreenOnEdge returns, 'this' has been freed.
Using a singleshot timer allows Edge::handle to return before the Edge is destroyed.
Prefer for() to foreach(), as the latter is deprecated.
Prefer iterating QList using the iteration_expression for() loops,
rather than doing it by index.
Currently, we don't compute the clip region properly for some client-
side decorated applications, for example gedit, due to mixing several
separate coordinate spaces.
This change ensures that the window pixmap shape and the opaque region
are in the same coordinate space - the window pixmap coordinate.
In order to simplify mapping regions from the window pixmap coordinates
to the global screen coordinates, a new helper method was introduced in
the WindowPixmap class - mapToGlobal().
If the Xwayland executable can't be found, the whole session will die
because a criticalError() signal will be emitted.
This change replaces the criticalError() signal with a less severe
signal.
If the errorOccurred() signal has been emitted during the startup
sequence, kwin won't die and will just continue with spawning the
session process.
After splitting out the server part of KWayland into a separate repo,
all non-core protocol wrappers in KWayland::Client had become obsolete
and using them in new projects is highly discouraged.
The switch case statement allows the compiler to optimize code. More
specifically, if the values are densely packed, then the compiler may
generate a jump table. The switch statement also looks cleaner.
As for the if statements in adjustWorkArea(), they were overlooked by
me after LayerSurfaceV1Interface::exclusiveEdge() had been introduced.
QPointer is a really useful way to store a pointer over time.
It doesn't make have any value as a return value used by a short-lived
method.
There isn't a good copy constructor, it's effectively the same as
creating a new QWeakPointer reference that has to be cleaned up.
Testing if something is null is still the same. A new QPointer can be
made by the caller if it actually is needed.
Input handling is a very hot path called many times a frame, so it's
important to keep this light. focus() and at() are called a lot which
added up to slightly over 1% of CPU time when moving the mouse about.