Summary:
KWin always has a few internal windows around which are not visible.
A QWindow created somewhere, but not shown. Such windows should not
be part of the stacking order.
If they are it breaks code which looks at the top most window in the
stacking order like e.g. SlidebackEffect.
This change ensures that the stacking order gets updated whenever a
ShellClient gets hidden and that internal windows with isShown being
false are excluded from the stacking order.
BUG: 364483
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2636
Summary:
Rational: unredirect fullscreen windows is a weird beast. It's intended
to make fullscreen windows "faster" by not compositing that screen. But
that doesn't really work as KWin jumps out of that condition pretty
quickly. E.g. whenever a tooltip window is shown. KWin itself has a
better functionality by supporting to block compositing completely.
The complete code was full of hacks around it to try to ensure that
things don't break.
Overall unredirect fullscreen has always been the odd one. We had it
because a compositor needs to have it, but it never got truly integrated.
E.g. effects don't interact with it properly so that some things randomly
work, others don't. Will it trigger the screenedge, probably yes, but
will it show the highlight: properly no.
By removing the functionality we finally acknowledge that this mode is
not maintained and has not been maintained for years and that we do not
intend to support it better in future. Over the years we tried to make
it more and more hidden: it's disabled for Intel GPUs, because it used
to crash KWin. It's marked as an "expert" option, etc.
It's clearly something we tried to hide from the user that it exists.
For Wayland the whole unredirect infrastructure doesn't make sense
either. There is no such thing as "unredirecting". We might make use
of passing buffers directly to the underlying stack, but that will be
done automatically when we know it can be done, not by some magic is
this a window of specific size.
Test Plan:
Compiles, cannot really test as I am an Intel user who never
had that working.
Reviewers: #kwin, #plasma, #vdg
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2180
For Wayland transients are popups relative to a parent surface. This
means for a dock window we obviously want them above the dock, otherwise
the context menu would be below the dock.
To not break the existing functionality (which makes sense) we bind
it to whether the transient has a positioning hint - that's only set
for ShellClients.
Merges together the code from ShellClient and Client and removes the
starting differences. Long term it's better to have only one
implementation to prevent diversions in the implementation.
As it doesn't match exactly protected virtual methods are called
which allow more specific implementations for a certain aspect of the
layer resolving.
Adds all internal ShellClients into a dedicated list. This ensures that
we don't perform "normal" window management on them.
In addition we add them to the top of the stacking order. This restores
behavior as it is on X11: internal windows are using BypassWindowManagerHint
and thus on top of everything.
Windows that "belong" to the desktop are
kept visible and do no break the state on
activation/mapping
REVIEW: 123783
CCBUG: 346837
CCBUG: 346933
CCBUG: 347212
Moves the properties and the base implementation into AbstractClient.
Methods invoke a new protected virtual method which is implemented in
Client to update the TabGroup.
This is an alternative approach suggested by the
NETWM spec.
The advantage is, that windows are not minimized
at all what apparently lead to some confusion
about the nature of the mode (which was abused
to tidy up) and a secret config key to allow for
that unrelated behavior.
Instead the ShowDesktopIsMinimizeAll key is removed
and replaced by a dedicated script + shortcut.
Bonus: less code to remember "minimized" windows =)
when restacking for shaded windows and uncomposited tabboxes
the group check should not be applied since we know better
eg. to restore a former order
CCBUG: 186206
REVIEW: 122469
Callgrind analysis showed that this method has room for improvement.
The bottle neck is mapping the Unmanaged against the list of windows
retreived from xcb_query_tree. The number of windows in that list is
rather large (>1000), which turns the loop into an expensive path.
Workspace::findUnmanaged seems to be too expensive for that due to the
overhead of using a functor and multiple method calls. The Inl. cost
before the optimization for checking ~55,000 windows is 2.46.
The change uses a good old const-iterator based loop over the unmanaged
list to check for the window. This reduces the Incl. cost for checking
~55,000 windows to 0.28.
REVIEW: 122067
The build option got introduced for Plasma Active back in a time
when we did not properly aim for convergence. In a Plasma 5 world
we want to have only one shell and one window manager which adjust
itself. This means we don't want a differently compiled kwin for
plasma active, but the same one. Thus the build option doesn't
make much sense any more. A KWin for touch interface needs to support
screenedges for the case that mouse is plugged in.
CCBUG: 340960
REVIEW: 121200
Instead of passing the macro based Predicate to findClient it now
expects a function which can be passed to std::find_if.
Existing code like:
xcb_window_t window; // our test window
Client *c = findClient(WindowMatchPredicated(window));
becomes:
Client *c = findClient([window](const Client *c) {
return c->window() == window;
});
The advantage is that it is way more flexible and has the logic what
to check for directly with the code and not hidden in the macro
definition.
In addition there is a simplified overload for the very common case of
matching a window id against one of Client's windows. This overloaded
method takes a Predicate and the window id.
Above example becomes:
Client *c = findClient(Predicate::WindowMatch, w);
Existing code is migrated to use the simplified method taking
MatchPredicate and window id. The very few cases where a more complex
condition is tested the lambda function is used. As these are very
local tests only used in one function it's not worthwhile to add further
overloads to the findClient method in Workspace.
With this change all the Predicate macro definitions are removed from
utils.h as they are now completely unused.
REVIEW: 116916
Instead of passing the macro based Predicate to findUnmanaged it now
expects a function which can be passed to std::find_if.
Existing code like:
xcb_window_t window; // our test window
Unmanaged *u = findUnmanaged(WindowMatchPredicated(window));
becomes:
Unmanaged *u = findUnmanaged([window](const Unmanaged *u) {
return u->window() == window;
});
In addition an overload is added which takes the window id to cover
the common case to search for an Unmanaged by its ID. The above example
becomes:
Unmanaged *u = findUnmanaged(window);
The advantage is that it is way more flexible and has the logic what
to check for directly with the code and not hidden in the macro
definition.
As can be seen in [1] the patches to KWin were in CVS HEAD before the
protocol got standardized and it never got any adoption. It's neither in
the NETWM spec, nor implemented in Qt4 nor in Qt5. KWin did not even add
the protocol to the NET::Supported property.
Thus it doesn't make much sense to keep a protocol which nobody speaks.
Still the code around the protocol is kept and also the names are kept.
Only difference is that Client::takeActivity got removed and the code
moved to the only calling place in Workspace. Motivated by that change
the enum defined in utils.h is moved into Workspace, it's turned into
a proper QFlags class and used as a type in the method argument instead
of a generic long.
[1] https://mail.gnome.org/archives/wm-spec-list/2004-April/msg00013.html
REVIEW: 116922
KWin starts to support the Notification window type and has an own
layer for all notification windows. They are kept above the above
layer but do not go over active fullscreen windows.
REVIEW: 115298
the restack code stacks under all members of an application
this is a problem if the group contains a keep below or desktop
etc. (while the other window is a normal one) what resulted in
restacking the client "invalidly" above the window of the other
layer but below all other memberso of its own group for no reason
REVIEW: 112627
CCBUG: 110543