The view is never shown or used in any way except to create the
QDeclarativeEngine. So instead of using a view as a wrapper, let's create
a QDeclarativeEngine and a Component and create the script from the
Component.
To have Plasma.Dialog working we also need to add the created script item
to a QGraphicsScene.
Following the approaches of other split out functionality Screens is a
singleton class created by Workspace.
The class takes over the responsibility for:
* screenChanged signal delayed by timer
* number of screens
* geometry of given screen
* active screen
* config option for active screen follows mouse
The class contains a small abstraction layer and has a concrete subclass
wrapping around QDesktopWidget, but the idea is to go more low level and
interact with XRandR directly to get more detailed information.
All over KWin the usage from QDesktopWidget is ported over to the new
Screens class.
REVIEW: 109839
This allows to move the slot to reset the decoration when compositing
got toggled from Workspace to DecorationPlugin and the custom cleanup
is no longer needed.
REVIEW: 109909
The define KWIN_SINGLETON adds to a class definition:
public:
static Foo *create(QObject *parent = 0);
static Foo *self() { return s_self; }
protected:
explicit Foo(QObject *parent = 0);
private:
static Foo *s_self;
There is an additional define KWIN_SINGLETON_VARIABLE to set a different
name than s_self.
The define KWIN_SINGLETON_FACTORY can be used to generate the create
method. It expands to:
Foo *Foo::s_self = 0;
Foo *Foo::create(QObject *parent)
{
Q_ASSERT(!s_self);
s_self = new Foo(parent);
return s_self;
}
In addition there are defines to again set a different variable name and
to create an object of another inheriting class.
All the classes currently using this pattern are adjusted to use these
new defines. In a few places the name was adjusted. E.g. in Compositor
the factory method was called createCompositor instead of create.
REVIEW: 109865
This code never worked (git blame ends at 05507ee2). The event type is
ColormapNotify (32) and not ColormapChangeMask (1<<23).
Nobody noticed for years so it seems like unneeded to be fixed.
REVIEW: 109912
There is only one instance hold by Workspace which means it should follow
the common approach with ::self and ::create.
The hasTabBox is completely removed as it's rather useless and the same
as the ifdef around the usages any way.
REVIEW: 109851
All activities related code moves into new singleton class Activities.
This class gets only included into the build if the build option is
enabled which means there are less ifdefs all over the code and it also
handles better the moc doesn't like ifdef case.
The class holds the list of open and all activites, the current and the
previous activity and the KActivities::Controller. It also emits the
signals for any activities related changes.
Workspace still contains some activities related code. That is the
adjustment on change of current activity. Nevertheless the code looks
much cleaner now and does not contain the confusing naming conflict with
takeActivity() which existed before.
In all the places where Activities got used the code got adjusted and
quite often the ifdef got added with a fallback for the disabled case.
LanczosFilter tries to discard all cached textures in the timer event by
getting the stacking order and iterating over it. But this approach seems
wrong from several aspects.
First of all the xStackingOrder does not include Deleted windows. So if
a cached texture still exists on an EffectWindow for a Deleted it would
not be discarded.
Also the xStackingOrder could result in an update from X because the
stacking order is currently considered dirty.
Last but not least the EffectsHandler::stackingOrder creates a temporary
list of EffectWindows - good for Effects but not necessarily useful
inside KWin core.
Instead the LanczosFilter gets the list of Clients, desktops, unmanaged
and deleted and iterates over them to check whether there is a texture to
discard.
REVIEW: 109954