This describes an additional offset for the client content. On X11
our client content position matches with the window - the window
decoration is part of the overall content coordinate system.
On Wayland the content is an own texture starting at 0/0. Thus a
mapping to texture coordinates will be required when server side
decorations are provided. The new information is used in the scene's
to adjust the rendering and generating of quads.
AbstractClient::mainClients is virtual and overriden in Client,
allMainClients has only a common implementation in AbstractClient.
In activation.cpp we still need one case where a temporary ClientList
needs to be constructed. Once transients are fully migrated that should
be removable again.
Toplevel::windowRole accesses WinInfo unconditionally causing crashes
if we have a Toplevel subclass which doesn't use WinInfo. So let's
make it virtual and copy to Deleted.
This was suggested to be done in a comment. The existing code might
have returned incorrect results for Client. So let's get the primary
window type and use that one.
Toplevel::opacity() accesses the WinInfo, but for a Wayland client
we won't have the opacity through the WinInfo, so let's have it as
a virtual method that a subclass can override. Also it needs to be
copied to Deleted to not have a Deleted of a Wayland client crash
because it accesses the not existing WinInfo.
The Renderer gets reparented to the Deleted. While passing it to
the Deleted the Scene's implementation can ensure that the buffers
are up to date. After passing to Deleted it's no longer allowed to
call the render method.
NOTE: this is not working completely yet, lots of code is still ifdefed
other parts are still broken.
The main difference for the new decoration API is that it is neither
QWidget nor QWindow based. It's just a QObject which processes input
events and has a paint method to render the decoration. This means all
the workarounds for the QWidget interception are removed. Also the paint
redirector is removed. Instead each compositor has now its own renderer
which can be optimized for the specific case. E.g. the OpenGL compositor
renders to a scratch image which gets copied into the combined texture,
the XRender compositor copies into the XPixmaps.
Input events are also changed. The events are composed into QMouseEvents
and passed through the decoration, which might accept them. If they are
not accpted we assume that it's a press on the decoration area allowing
us to resize/move the window. Input events are not completely working
yet, e.g. wheel events are not yet processed and double click on deco
is not yet working.
Overall KDecoration2 is way more stateful and KWin core needs more
adjustments for it. E.g. borders are allowed to be disabled at any time.
The frameId only makes sense for a Client, in case of Unmanaged the
same window id is used as for the window() handle. Client creates the
frame and destroys it.
Given that it makes sense to let Client manage the frame properly.
The ::frameId() is therefore virtual and as base implementation it
returns the client id. Client reimplements it and returns the proper
frame id.
Method is also implemented in Deleted as it used to be passed to
deleted.
fixing bug by deferring the deletion and removal of the
deleted to the next event cycle had the side effect that
this now happens in the event cycle of the compositor
restart, which was deferred to avoid precisely that...
so the test is now moved to the removal of the deleted
which got an additional flag wasClient to avoid calling
this action for each and every tooltip (and might be usable
elsewise)
BUG: 321537
FIXED-IN: 4.11
REVIEW: 111204
The only task of the PaintRedirector is to redirect the painting of the
window decorations into Pixmaps. So it should actually do this by also
handling the four pixmaps for the decoration. This simplifies the code
as all the logic concerning redirecting the painting is now grouped
together.
Furthermore the PaintRedirector is now a child of the decoration widget,
which means it gets automatically destroyed whenever the decoration is
destroyed - the Client does not have to care about it.
Also the PaintRedirector gets only created if the Compositor is active as
it is not needed in the non-compositing case.
REVIEW: 106620
The code was basically copy'n'pasted to handle both Client and Deleted
requiring to cast the Toplevel to both Client and Deleted to test whether
it is one of those.
This is now changed from runtime to compile time polymorphism. A
templated method is used to start the rendering process for the decos.
This on the one hand simplifies the code and on the other does not
require any dynamic casts any more as we use the available check on
Toplevel whether it is a Client or Deleted.
The method windowType needs actually two implementations:
* one for Clients
* one for Unmanaged
as for Clients also the window rules are checked and hacks are applied
which is both not needed for Unmanaged windows.
To have the Client specific behavior in windowType the function used to
perform two dynamic_casts which made this method one of the most
expensive during compositing, e.g. for ~1000 frames
* called ~43000 times
* ~85000 dynamic casts
* incl. cost of method: 0.24
* self cost of method: 0.05
* incl. cost of the casts: 0.12
After the change to remove the dynamic casts we have for ~1500 frames
in Client::windowType:
* called ~31000 times
* incl. cost of 0.06
* self cost of 0.02
Calls on Unmanaged and Deleted are so low that we do not need to consider
them.
BUG: 306384
FIXED-IN: 4.10
REVIEW: 106349
Ensures that we can access the minimized property in Effects
which want to not animate a closed, minimized window.
Make use of it in the Fade Effect Script to not fade out a
minimized window which would mean showing the actual not
visible window.
BUG: 303891
FIXED-IN: 4.9.0
REVIEW: 105647
This allows to copy the layer to the deleted window in order to
keep the deleted window in the same layer.
Additionally a new layer is added for unmanaged windows.
Property invokes virtual methods returning false by default. Deleted
reimplements the isDeleted and returns true. Client returns true for
isClient. Method is not called isManaged as this is already used
inside Client.
In some unfortunate situations it is possible that a window is deleted
before it is marked ready_for_painting=true. The last point is
especially troublesome for effects that reference the deleted window.
Many thanks to Elias Probst for all the testing.
CCBUG: 290025
CCBUG: 288948
REVIEW: 103733
ok'd by fredrikh.
this code is buggy right now, but I promise to squash the bugs by the 19th :)
svn path=/trunk/KDE/kdebase/workspace/; revision=1125614
As this is a bigger commit I will wait with backporting to 4.3 for something about two or three weeks and will only backport if nobody yells.
BUG: 201780
svn path=/trunk/KDE/kdebase/workspace/; revision=1004096
and not be slowed down by going through compositing. Turned on and no UI option
in the naive hope that it won't cause any real problems. Maybe effects doing
window previews should get API to suspend unredirect though.
svn path=/trunk/KDE/kdebase/workspace/; revision=851742
being v2+ (right now it says just GPL, which according to GPL itself
means any GPL). Decoration clients will come later.
CCMAIL: kwin@kde.org
svn path=/trunk/KDE/kdebase/workspace/; revision=742302
Reverting r700026 and changing floats to doubles again. I'd probably like
to change even the ones interfacing with OpenGL which I've left for now.
svn path=/trunk/KDE/kdebase/workspace/; revision=707987
change slides the old desktop out and the new one in. Should not
be really technically different from the cube.
svn path=/branches/work/kwin_composite/; revision=629163
instances and keeping them around after the window is closed, create
class Deleted as a representation of a closed window.
(Why do I always forget 'svn add'?)
svn path=/branches/work/kwin_composite/; revision=626357