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
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.
Since the introduction of VirtualDesktopManager we do have a signal
emitted when the desktop layout changes which we can use as NOTIFY for
the desktopGrid properties.
REVIEW: 108953
The ownership for virtual desktops is moved from Workspace into a new
VirtualDesktopManager. The manager is responsible for providing the count
of virtual desktops and keeping track of the currently used virtual
desktop.
All methods related to moving between desktops are also moved from
Workspace to the new manager, though all methods related to Clients on
Virtual Desktops remain in Workspace for the time being. This is to have
the new manager as independent from KWin core as possible.
An rather important change for the handling of virtual desktops is that
the count and the id of a desktop is now an unsinged integer instead of
an integer. The reason for that is that we cannot have a negative count
of desktops as well as it is not possible to be on a desktop with a
negative identifier.
In that regard it is important to remember that a Client can be on a
desktop with a negative identifier. The special value for a Client being
on all desktops is handled by using -1 as a desktop. For the time being
this is not adjusted but instead of comparing the virtual desktop ids one
should prefer to use the convenient methods like isOnDesktop and
isOnAllDesktops. This would allow in future to internally change the
representation for on all desktops.
New properties for the current activity and the available
activities plus related signals in scripts. Signals added to
effects.
BUG: 302060
FIXED-IN: 4.9.0
If workspace is exported as a context property there seem to be
issues with the signals which are not bound to a property of
WorkspaceWrapper.
This problems seems to be fixable by exporting the workspace
property as a global property on the script engine.
As a side-effect this also resolves the issue with the clientList,
so we can drop the hack again.
REVIEW: 104682
Sometimes Qt is surprising. Apparently QML has problems with a
QList<KWin::Client*> and wants to have a QList<QObject*> which
cannot be used in QtScript.
There ends my dream of having one API for both JavaScript and QML.
So with QtScript it is:
workspace.clientList()
and in QML it is:
workspace.getClientList()
Client has a property for demands attention and Workspace
is emitting a signal whenever the demands attention state
of any Client changes.
REVIEW: 104204
This adds extensive support information about the running instance
by printing out all used options, the compositing information
including GL platform, loaded effects and active effects.
The debug output can be retrieved through D-Bus:
qdbus org.kde.kwin /KWin supportInformation
or through a KWin Script (use desktop console):
print(workspace.supportInformation())
REVIEW: 104142
All slots not requiring to be triggered from a QAction are exported.
This means that switchToDesktop is not exported but also not required,
as we have this through the properties.
Needs documentation...
For this a new MetaObject "KWin" is exported to have the
enum ClientAreaOption available in scripts. Unfortunately this
requires duplicating the enum from kwinglobals.h.