2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2012-08-30 06:20:26 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
|
2012-08-30 06:20:26 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2012-08-30 06:20:26 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_DBUS_INTERFACE_H
|
|
|
|
#define KWIN_DBUS_INTERFACE_H
|
|
|
|
|
2013-02-26 08:00:51 +00:00
|
|
|
#include <QObject>
|
2018-06-05 10:52:57 +00:00
|
|
|
#include <QtDBus>
|
2012-08-30 06:20:26 +00:00
|
|
|
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
#include "virtualdesktopsdbustypes.h"
|
|
|
|
|
2012-08-30 06:20:26 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
class Compositor;
|
2020-11-07 19:34:55 +00:00
|
|
|
class PluginManager;
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
class VirtualDesktopManager;
|
2014-06-02 06:51:28 +00:00
|
|
|
|
2012-08-30 06:20:26 +00:00
|
|
|
/**
|
|
|
|
* @brief This class is a wrapper for the org.kde.KWin D-Bus interface.
|
|
|
|
*
|
|
|
|
* The main purpose of this class is to be exported on the D-Bus as object /KWin.
|
|
|
|
* It is a pure wrapper to provide the deprecated D-Bus methods which have been
|
|
|
|
* removed from Workspace which used to implement the complete D-Bus interface.
|
|
|
|
*
|
|
|
|
* Nowadays the D-Bus interfaces are distributed, parts of it are exported on
|
|
|
|
* /Compositor, parts on /Effects and parts on /KWin. The implementation in this
|
|
|
|
* class just delegates the method calls to the actual implementation in one of the
|
|
|
|
* three singletons.
|
|
|
|
*
|
|
|
|
* @author Martin Gräßlin <mgraesslin@kde.org>
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2018-02-12 20:40:05 +00:00
|
|
|
class DBusInterface: public QObject, protected QDBusContext
|
2012-08-30 06:20:26 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.KWin")
|
|
|
|
public:
|
2012-12-29 06:34:38 +00:00
|
|
|
explicit DBusInterface(QObject *parent);
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~DBusInterface() override;
|
2012-08-30 06:20:26 +00:00
|
|
|
|
|
|
|
public: // PROPERTIES
|
|
|
|
public Q_SLOTS: // METHODS
|
|
|
|
Q_NOREPLY void cascadeDesktop();
|
|
|
|
int currentDesktop();
|
|
|
|
Q_NOREPLY void killWindow();
|
|
|
|
void nextDesktop();
|
|
|
|
void previousDesktop();
|
|
|
|
Q_NOREPLY void reconfigure();
|
|
|
|
bool setCurrentDesktop(int desktop);
|
|
|
|
bool startActivity(const QString &in0);
|
|
|
|
bool stopActivity(const QString &in0);
|
|
|
|
QString supportInformation();
|
|
|
|
Q_NOREPLY void unclutterDesktop();
|
2016-03-14 09:23:52 +00:00
|
|
|
Q_NOREPLY void showDebugConsole();
|
2021-01-30 00:37:13 +00:00
|
|
|
Q_NOREPLY void replace();
|
2012-08-30 06:20:26 +00:00
|
|
|
|
2018-02-12 20:40:05 +00:00
|
|
|
QVariantMap queryWindowInfo();
|
2021-10-28 00:30:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a map with information about the window.
|
|
|
|
*
|
|
|
|
* The map includes entries such as position, size, status, and more.
|
|
|
|
*
|
|
|
|
* @param uuid is a QUuid from Toplevel::internalId().
|
|
|
|
*/
|
2018-12-08 16:06:51 +00:00
|
|
|
QVariantMap getWindowInfo(const QString &uuid);
|
2018-02-12 20:40:05 +00:00
|
|
|
|
2012-12-29 23:15:30 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void becomeKWinService(const QString &service);
|
2014-10-13 20:35:04 +00:00
|
|
|
|
|
|
|
private:
|
2015-01-23 08:06:05 +00:00
|
|
|
void announceService();
|
2014-10-13 20:35:04 +00:00
|
|
|
QString m_serviceName;
|
2018-02-12 20:40:05 +00:00
|
|
|
QDBusMessage m_replyQueryWindowInfo;
|
2012-08-30 06:20:26 +00:00
|
|
|
};
|
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
class CompositorDBusInterface : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Compositing")
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* @brief Whether the Compositor is active. That is a Scene is present and the Compositor is
|
|
|
|
* not shutting down itself.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
Q_PROPERTY(bool active READ isActive)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* @brief Whether compositing is possible. Mostly means whether the required X extensions
|
|
|
|
* are available.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
Q_PROPERTY(bool compositingPossible READ isCompositingPossible)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* @brief The reason why compositing is not possible. Empty String if compositing is possible.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
Q_PROPERTY(QString compositingNotPossibleReason READ compositingNotPossibleReason)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* @brief Whether OpenGL has failed badly in the past (crash) and is considered as broken.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
Q_PROPERTY(bool openGLIsBroken READ isOpenGLBroken)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* The type of the currently used Scene:
|
|
|
|
* @li @c none No Compositing
|
|
|
|
* @li @c gl1 OpenGL 1
|
|
|
|
* @li @c gl2 OpenGL 2
|
|
|
|
* @li @c gles OpenGL ES 2
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
Q_PROPERTY(QString compositingType READ compositingType)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* @brief All currently supported OpenGLPlatformInterfaces.
|
|
|
|
*
|
|
|
|
* Possible values:
|
|
|
|
* @li glx
|
|
|
|
* @li egl
|
|
|
|
*
|
|
|
|
* Values depend on operation mode and compile time options.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
Q_PROPERTY(QStringList supportedOpenGLPlatformInterfaces READ supportedOpenGLPlatformInterfaces)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2016-08-26 10:56:25 +00:00
|
|
|
Q_PROPERTY(bool platformRequiresCompositing READ platformRequiresCompositing)
|
2014-06-02 06:51:28 +00:00
|
|
|
public:
|
|
|
|
explicit CompositorDBusInterface(Compositor *parent);
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~CompositorDBusInterface() override = default;
|
2014-06-02 06:51:28 +00:00
|
|
|
|
|
|
|
bool isActive() const;
|
|
|
|
bool isCompositingPossible() const;
|
|
|
|
QString compositingNotPossibleReason() const;
|
|
|
|
bool isOpenGLBroken() const;
|
|
|
|
QString compositingType() const;
|
|
|
|
QStringList supportedOpenGLPlatformInterfaces() const;
|
2016-08-26 10:56:25 +00:00
|
|
|
bool platformRequiresCompositing() const;
|
2014-06-02 06:51:28 +00:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
/**
|
|
|
|
* @brief Suspends the Compositor if it is currently active.
|
|
|
|
*
|
2019-01-12 10:31:32 +00:00
|
|
|
* Note: it is possible that the Compositor is not able to suspend. Use isActive to check
|
2014-06-02 06:51:28 +00:00
|
|
|
* whether the Compositor has been suspended.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @see resume
|
|
|
|
* @see isActive
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
void suspend();
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2014-06-02 06:51:28 +00:00
|
|
|
/**
|
|
|
|
* @brief Resumes the Compositor if it is currently suspended.
|
|
|
|
*
|
|
|
|
* Note: it is possible that the Compositor cannot be resumed, that is there might be Clients
|
2019-01-12 10:31:32 +00:00
|
|
|
* blocking the usage of Compositing or the Scene might be broken. Use isActive to check
|
|
|
|
* whether the Compositor has been resumed. Also check isCompositingPossible and
|
|
|
|
* isOpenGLBroken.
|
2014-06-02 06:51:28 +00:00
|
|
|
*
|
|
|
|
* Note: The starting of the Compositor can require some time and is partially done threaded.
|
|
|
|
* After this method returns the setup may not have been completed.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @see suspend
|
|
|
|
* @see isActive
|
|
|
|
* @see isCompositingPossible
|
|
|
|
* @see isOpenGLBroken
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2014-06-02 06:51:28 +00:00
|
|
|
void resume();
|
2021-10-28 15:12:54 +00:00
|
|
|
|
2019-07-02 18:28:45 +00:00
|
|
|
/**
|
|
|
|
* @brief Used by Compositing KCM after settings change.
|
|
|
|
*
|
|
|
|
* On signal Compositor reloads settings and restarts.
|
|
|
|
*/
|
|
|
|
void reinitialize();
|
2014-06-02 06:51:28 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void compositingToggled(bool active);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Compositor *m_compositor;
|
|
|
|
};
|
|
|
|
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
//TODO: disable all of this in case of kiosk?
|
|
|
|
|
|
|
|
class VirtualDesktopManagerDBusInterface : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.VirtualDesktopManager")
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of virtual desktops currently available.
|
|
|
|
* The ids of the virtual desktops are in the range [1, VirtualDesktopManager::maximum()].
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
Q_PROPERTY(uint count READ count NOTIFY countChanged)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
/**
|
|
|
|
* The number of rows the virtual desktops will be laid out in
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
Q_PROPERTY(uint rows READ rows WRITE setRows NOTIFY rowsChanged)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
/**
|
|
|
|
* The id of the virtual desktop which is currently in use.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
Q_PROPERTY(QString current READ current WRITE setCurrent NOTIFY currentChanged)
|
2021-10-28 15:12:54 +00:00
|
|
|
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
/**
|
|
|
|
* Whether navigation in the desktop layout wraps around at the borders.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
Q_PROPERTY(bool navigationWrappingAround READ isNavigationWrappingAround WRITE setNavigationWrappingAround NOTIFY navigationWrappingAroundChanged)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* list of key/value pairs which every one of them is representing a desktop
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
Q_PROPERTY(KWin::DBusDesktopDataVector desktops READ desktops NOTIFY desktopsChanged);
|
|
|
|
|
|
|
|
public:
|
|
|
|
VirtualDesktopManagerDBusInterface(VirtualDesktopManager *parent);
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~VirtualDesktopManagerDBusInterface() override = default;
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
|
|
|
|
uint count() const;
|
|
|
|
|
|
|
|
void setRows(uint rows);
|
|
|
|
uint rows() const;
|
|
|
|
|
|
|
|
void setCurrent(const QString &id);
|
|
|
|
QString current() const;
|
|
|
|
|
|
|
|
void setNavigationWrappingAround(bool wraps);
|
|
|
|
bool isNavigationWrappingAround() const;
|
|
|
|
|
|
|
|
KWin::DBusDesktopDataVector desktops() const;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void countChanged(uint count);
|
|
|
|
void rowsChanged(uint rows);
|
|
|
|
void currentChanged(const QString &id);
|
|
|
|
void navigationWrappingAroundChanged(bool wraps);
|
|
|
|
void desktopsChanged(KWin::DBusDesktopDataVector);
|
|
|
|
void desktopDataChanged(const QString &id, KWin::DBusDesktopDataStruct);
|
|
|
|
void desktopCreated(const QString &id, KWin::DBusDesktopDataStruct);
|
|
|
|
void desktopRemoved(const QString &id);
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
/**
|
|
|
|
* Create a desktop with a new name at a given position
|
|
|
|
* note: the position starts from 1
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)
Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
Reviewers: #plasma, #kwin, graesslin, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: hein, zzag, davidedmundson, kwin
Tags: #kwin
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13887
2018-10-29 22:29:15 +00:00
|
|
|
void createDesktop(uint position, const QString &name);
|
|
|
|
void setDesktopName(const QString &id, const QString &name);
|
|
|
|
void removeDesktop(const QString &id);
|
|
|
|
|
|
|
|
private:
|
|
|
|
VirtualDesktopManager *m_manager;
|
|
|
|
};
|
|
|
|
|
2020-11-07 19:34:55 +00:00
|
|
|
class PluginManagerDBusInterface : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.KWin.Plugins")
|
|
|
|
|
|
|
|
Q_PROPERTY(QStringList LoadedPlugins READ loadedPlugins)
|
|
|
|
Q_PROPERTY(QStringList AvailablePlugins READ availablePlugins)
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit PluginManagerDBusInterface(PluginManager *manager);
|
|
|
|
|
|
|
|
QStringList loadedPlugins() const;
|
|
|
|
QStringList availablePlugins() const;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
bool LoadPlugin(const QString &name);
|
|
|
|
void UnloadPlugin(const QString &name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
PluginManager *m_manager;
|
|
|
|
};
|
|
|
|
|
2012-08-30 06:20:26 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif // KWIN_DBUS_INTERFACE_H
|