Commit Graph

7 Commits (976037717b9a2552b80f134e9b8c95be62238529)

Author SHA1 Message Date
Martin Gräßlin 62c4d449f5 Use signals'n'slots instead of deep function call into Compositor
For most actions where the compositor needs to perform an action
(e.g. scheduling another repaint) signals were already emitted.
So it's easier to just connect the signals to the Compositor
which in turn makes the code much more readable.

All signals are connected from the Workspace when either the
Compositor gets constructed or a Toplevel gets created.
2012-08-26 20:44:46 +02:00
Martin Gräßlin 0f2e5e61a8 Move reinitializeCompositing and restartKWin into the Compositor
The DBus signal which causes KWin to reinitialize the Compositor
is moved into the Compositor as everything can be handled from
there as well. This comes together with moving the restartKWin
functionality into the Compositor as it is only relevant there.
Restart will only happen if the wrong Qt graphicssystem is used
for the chosen compositing backend.
2012-08-26 20:44:46 +02:00
Martin Gräßlin df6c423962 Connect the lost CM Ownership directly to finish slot
All the custom slot did was printing a debug statement and
calling finish. We do not need this debug statement. The times
of Compositors not part of Window Managers are over, so it is
extremely unlikely that we lose the ownership without KWin
going down anyway.
2012-08-26 20:43:57 +02:00
Martin Gräßlin 28a5487d4d Drop compositing prefixes from methods and variables in Compositor
Yes everything in the Compositor is related to compositing, no
need to state it everywhere.
2012-08-26 20:43:57 +02:00
Martin Gräßlin 2d954a6bf3 Make the Scene owned by the Compositor
The Scene has always been created and destroyed inside what is
now the split out compositor. Which means it is actually owned
by the Compositor. The static pointer has never been needed
inside KWin core. Access to the Scene is not required for the
Window Manager. The only real usage is in the EffectsHandlerImpl
and in utils.h to provide a convenient way to figure out whether
compositing is currently active (scene != NULL).

The EffectsHandlerImpl gets also created by the Compositor after
the Scene is created and gets deleted just before the Scene gets
deleted. This allows to inject the Scene into the EffectsHandlerImpl
to resolve the static access in this class.

The convenient way to access the compositing() in utils.h had
to go. To provide the same feature the Compositor provides a
hasScene() access which has the same behavior as the old method.
In order to keep the code changes small in Workspace and Toplevel
a new method compositing() is defined which properly resolves
the state. A disadvantage is that this can no longer be inlined
and consists of several method calls and pointer checks.
2012-08-26 20:43:57 +02:00
Martin Gräßlin 523b537962 Use singleton accessor for Workspace in Compositor
Replaces the member variable which is actually not needed as a
pointer to the Workspace can always be retrieved through the
singleton accessor of Workspace.
2012-08-26 20:43:56 +02:00
Arthur Arlt f3739469a2 Move Workspace's compositing functions to own class Compositor
All Workspace functions which were implemented in the file composite.cpp
were moved to an own class Compositor. The header entries were moved as well.
All functions calls are updated.
2012-08-26 20:43:56 +02:00