This reverts commit 9d4c8fda09.
Unlike other effects this wasn't using hide/show as a hack for not
having a created/destroyed signal but because the window is internally
hidden when it's in auto-hide mode despite being still mapped.
BUG: 426686
Currently, if kwin/wayland runs without xwayland, the order in which
windows are painted doesn't actually reflect the true stacking order.
If the stacking order has been changed, we need to invalidate the
cached x stacking order. But it's done only when RootInfo is present.
If Xwayland doesn't run, RootInfo is not available and thus window
raising is completely broken.
With this change, the x stacking order will be invalidated every time
some window has been raised, no matter what mode kwin operates in.
If showOnScreenEdge is called, immediately followed by the client's destruction, it's possible that the next event queue process will call raiseClient with a destroyed client.
We avoid this by using singleShot that is lifetime-aware.
This change replaces the remaining usages of the old connect syntax with
the new connect syntax.
Unfortunately, there are still places where we have to use SIGNAL() and
SLOT() macros, for example the stuff that deals with d-bus business.
Clazy was used to create this change. There were a few cases that needed
manual intervention, the majority of those cases were about resolving
ambiguity caused by overloaded signals.
Currently, we do some sort of window placement only for decorated
internal windows, which feels hacky.
With this change, all internal clients will go through the window
placement code, unless it's a popup or the BypassWindowManagerHint
flag is set.
If the BypassWindowManagerHint flag is set, the window must have
valid position.
CCBUG: 400675
Currently, whenever the focused text input surface changes, the virtual
keyboard will create a bunch of excessive connections. This is leftover
after the old design.
No need to create x_stacing by iterating over stacking_order, it can be
copied. We are not performing any operations over it.
Also no need to instanciate the tree until we want to use it.
Uses a setter and clear method pattern rather than having the code
repeated.
Instead of keeping a QPointer, now we are a QObject and we get notified
about destruction intention directly, so we can clear the pointer when
necessary.
Instead of looping through the rects in the region, emit the region at
bulk. It reduces the amount of emissions we do and allows us to pack the
response accordingly.
Instead of putting code in lambda put them in actual slots, this is
right now not useful but when e.g. TextInputV3 is implemented, this way
we can re-use them.
This also simplifies the code little bit and makes it easier to use with
gdb if needed.
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.