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
Main motivation for this change is that it's unhandy to have the class
definition in workspace.h and client.h while the implementation is in
events.cpp although nothing in events.cpp uses it directly.
By getting it out of workspace.h we get the header a little bit smaller
which should improve compile time given that it's included almost
everywhere.
In events.cpp the enum usage is changed to NETWinInfo as that's the class
where they are defined.
RootInfo does no longer hold a workspace pointer. Where it's needed it
uses the singleton accessor of Workspace.
REVIEW: 110199
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
Workspace::addDeleted swaps the Client with the Deleted in the
stacking order. For Unmanaged windows the Deleted is appended
to the stacking order which is the same layer.
When the deleted is closed the window is removed from the stacking
order.
The result is that a deleted window is no longer raised above all
other clients.
REVIEW: 104519
BUG: 158262
FIXED-IN: 4.9.0
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
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
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