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
A new ClientModel is added which provides multiple different views on
KWin's Clients. The model is organized as a tree model supporting the
following levels:
* activities
* virtual desktops
* screens
* none
The levels can be ordered in whatever way one wants. That is the tree
structure can have an ordering of activities then virtual desktops or
the other way around.
In addition the model provides Exclusion flags to exclude clients of
certain types. E.g. it's possible to exclude all windows which are not on
the current desktop or all windows which are of type dock.
The model gets automatically updated whenever a Client is added/removed
or changes a state in a way that it should be excluded/included.
The ClientModel is not directly exported to QML. Instead there are
specific sub classes for certain common orderings. This solutions is
chosen to workaround some limitations of QML. The initial idea was to
use a property taking a list of the levels, but this doesn't work because
we are not notified when the QDeclarativeListProperty changes.
Currently the following models are provided to QML:
* ClientModel -> no restrictions
* ClientModelByScreen -> ordering by screen
* ClientModelByScreenAndDesktop -> screen, then desktop
These can be used to get all Clients:
ClientModel {
}
Or to get the classic Present Windows on current desktop:
ClientModelByScreen {
exclusions: ClientModel.OtherDesktopsExclusion | ClientModel.NotAcceptingFocusExclusion | ...
}
Or to get the classic Present Windows on all desktops:
ClientModelByScreen {
exclusions: ClientModel.NotAcceptingFocusExclusion | ...
}
Or our well known desktop grid:
ClientModelByScreenAndDesktop {
id: desktopGrid
exclusions: ClientModel.NotAcceptingFocusExclusion | ...
}
To support filtering as known by the Present Windows effect one can use
a ClientFilterModel, which is a QSortFilterProxyModel filtering on
window caption, role and class:
ClientFilterModel {
id: filterModel
clientModel: desktopGrid
filter: filterItem.text
}
In case it's a tree level obviously QML does not support this correctly.
So we need to use a VisualDataModel:
VisualDataModel {
id: clientModel
model: filterModel
Component.onCompleted: {
clientModel.rootIndex = modelIndex(0);
clientModel.rootIndex = modelIndex(0);
clientModel.delegate = thumbnailDelegate;
}
}
As we can see, the rootIndex has to be set to the level which contains
the Clients. Also it seems to be important to create the delegate after
the model index has been set. The idea is to have only one ClientModel
and multiple VisualDataModels if multiple views on the data is needed.
The model has been tested with a painful modeltest session. It looks good
so far modulo the listed limitations and that modeltest is not liking
closing Yakuake in the ClientModelByScreenAndDesktop setup, though it
works fine in real world testing.
REVIEW: 109604
Makes it a little bit easier to use a ThumbnailItem for a Client. E.g.
ThumbnailItem {
client: model.client
}
instead of mapping the windowIds, which is rather uncomfty.
Two new properties saturation and brightness are added to the
ThumbnailItem which can be set from QML.
The properties are honoured by the Scene when rendering the thumbnail.
Instead of calculating the screen number each time screen() is invoked,
the screen number gets stored in a private member variable and evaluated
whenever either the screen count changes or the Toplevel's geometry
changes. During move/resize the screen property doesn't get updated. The
update is delayed till the end of the move/resize operation.
REVIEW: 109715
and btw. replace legacy "ignoreposition" by "ignoregeometry"
this will allow to use "apply initially" as "force" used to act
(ignore position on placement) and "force" to prevent clients
from reconfiguring themselves (to not break a tabgroup or to just
not be annoying)
BUG: 311720
CCBUG: 252314
REVIEW: 109691
FIXED-IN: 4.11
Also harmonize script parsing - any combination of animationarray
and global animation setting that results in a valid animation is
possible using the global settings as default on the array values
REVIEW: 109212
this broke re-embedding clients
XReparentWindow causes an unmap of mapped clients, currently leading into releaseClient()
This will (among other) eg. reparent the client to the root and this is (usually?) executed after the original XReparentWindow, so the client does not end up where it's supposed to be.
REVIEW: 109484
REVIEW: 103948
BUG: 91703
BUG: 299245
FIXED-IN: 4.11
- The setting is ignored, the decoration always gets a "true" for it
- moving a maximized window requires breaking a "strong" snap (1/16 of screen height - unless you use quick maximization)
- all snapping is done towards the client, not the frame
- QuickTileMode is exported to the decoration (just as the maximizeMode) so that it can fix the bordersize alongside that.
not that i really like using QWidgetAction, but it'll
prevent the popup from autoclosing.
Introduce activityUpdateBlocking to prevent users from
removing the popup under their fingertips
BUG: 283309
FIXED-IN: 4.10.2
REVIEW: 107762
I've no real idea what breaks the theme -> qml assignment but the patch
re/creates the theme object (just as the engine and component) with the theme
BUG: 316033
FIXED-IN: 4.10.2
REVIEW: 109273