2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2018 Marco Martin <mart@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
// Qt
|
2023-07-03 19:28:19 +00:00
|
|
|
#include <QSignalSpy>
|
|
|
|
#include <QTest>
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
// KWin
|
2023-09-13 05:52:59 +00:00
|
|
|
#include "wayland/compositor.h"
|
2022-04-22 09:27:33 +00:00
|
|
|
#include "wayland/display.h"
|
2023-09-13 05:52:59 +00:00
|
|
|
#include "wayland/plasmavirtualdesktop.h"
|
|
|
|
#include "wayland/plasmawindowmanagement.h"
|
2022-04-22 09:27:33 +00:00
|
|
|
|
2020-04-29 13:59:23 +00:00
|
|
|
#include "KWayland/Client/compositor.h"
|
|
|
|
#include "KWayland/Client/connection_thread.h"
|
|
|
|
#include "KWayland/Client/event_queue.h"
|
2021-08-29 05:11:06 +00:00
|
|
|
#include "KWayland/Client/plasmavirtualdesktop.h"
|
|
|
|
#include "KWayland/Client/plasmawindowmanagement.h"
|
2020-04-29 13:59:23 +00:00
|
|
|
#include "KWayland/Client/region.h"
|
|
|
|
#include "KWayland/Client/registry.h"
|
|
|
|
#include "KWayland/Client/surface.h"
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
class TestVirtualDesktop : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TestVirtualDesktop(QObject *parent = nullptr);
|
|
|
|
private Q_SLOTS:
|
|
|
|
void init();
|
|
|
|
void cleanup();
|
|
|
|
|
|
|
|
void testCreate();
|
2019-01-22 09:18:46 +00:00
|
|
|
void testSetRows();
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
void testConnectNewClient();
|
|
|
|
void testDestroy();
|
|
|
|
void testActivate();
|
|
|
|
|
|
|
|
void testEnterLeaveDesktop();
|
|
|
|
void testAllDesktops();
|
|
|
|
void testCreateRequested();
|
|
|
|
void testRemoveRequested();
|
|
|
|
|
|
|
|
private:
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::Display *m_display;
|
|
|
|
KWin::CompositorInterface *m_compositorInterface;
|
|
|
|
KWin::PlasmaVirtualDesktopManagementInterface *m_plasmaVirtualDesktopManagementInterface;
|
|
|
|
KWin::PlasmaWindowManagementInterface *m_windowManagementInterface;
|
|
|
|
KWin::PlasmaWindowInterface *m_windowInterface;
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
KWayland::Client::ConnectionThread *m_connection;
|
|
|
|
KWayland::Client::Compositor *m_compositor;
|
|
|
|
KWayland::Client::PlasmaVirtualDesktopManagement *m_plasmaVirtualDesktopManagement;
|
|
|
|
KWayland::Client::EventQueue *m_queue;
|
|
|
|
KWayland::Client::PlasmaWindowManagement *m_windowManagement;
|
|
|
|
KWayland::Client::PlasmaWindow *m_window;
|
|
|
|
|
|
|
|
QThread *m_thread;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const QString s_socketName = QStringLiteral("kwayland-test-wayland-virtual-desktop-0");
|
|
|
|
|
|
|
|
TestVirtualDesktop::TestVirtualDesktop(QObject *parent)
|
|
|
|
: QObject(parent)
|
|
|
|
, m_display(nullptr)
|
|
|
|
, m_compositorInterface(nullptr)
|
|
|
|
, m_connection(nullptr)
|
|
|
|
, m_compositor(nullptr)
|
|
|
|
, m_queue(nullptr)
|
|
|
|
, m_thread(nullptr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::init()
|
|
|
|
{
|
2023-09-13 17:59:29 +00:00
|
|
|
using namespace KWin;
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
delete m_display;
|
2023-09-13 17:59:29 +00:00
|
|
|
m_display = new KWin::Display(this);
|
2020-10-19 15:52:56 +00:00
|
|
|
m_display->addSocketName(s_socketName);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_display->start();
|
|
|
|
QVERIFY(m_display->isRunning());
|
|
|
|
|
|
|
|
// setup connection
|
|
|
|
m_connection = new KWayland::Client::ConnectionThread;
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy connectedSpy(m_connection, &KWayland::Client::ConnectionThread::connected);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_connection->setSocketName(s_socketName);
|
|
|
|
|
|
|
|
m_thread = new QThread(this);
|
|
|
|
m_connection->moveToThread(m_thread);
|
|
|
|
m_thread->start();
|
|
|
|
|
|
|
|
m_connection->initConnection();
|
|
|
|
QVERIFY(connectedSpy.wait());
|
|
|
|
|
|
|
|
m_queue = new KWayland::Client::EventQueue(this);
|
|
|
|
QVERIFY(!m_queue->isValid());
|
|
|
|
m_queue->setup(m_connection);
|
|
|
|
QVERIFY(m_queue->isValid());
|
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
KWayland::Client::Registry registry;
|
|
|
|
QSignalSpy compositorSpy(®istry, &KWayland::Client::Registry::compositorAnnounced);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy plasmaVirtualDesktopManagementSpy(®istry, &KWayland::Client::Registry::plasmaVirtualDesktopManagementAnnounced);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy windowManagementSpy(®istry, &KWayland::Client::Registry::plasmaWindowManagementAnnounced);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QVERIFY(!registry.eventQueue());
|
|
|
|
registry.setEventQueue(m_queue);
|
|
|
|
QCOMPARE(registry.eventQueue(), m_queue);
|
|
|
|
registry.create(m_connection->display());
|
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
|
|
|
|
2020-12-09 20:13:19 +00:00
|
|
|
m_compositorInterface = new CompositorInterface(m_display, m_display);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QVERIFY(compositorSpy.wait());
|
|
|
|
m_compositor = registry.createCompositor(compositorSpy.first().first().value<quint32>(), compositorSpy.first().last().value<quint32>(), this);
|
|
|
|
|
2020-12-09 20:13:19 +00:00
|
|
|
m_plasmaVirtualDesktopManagementInterface = new PlasmaVirtualDesktopManagementInterface(m_display, m_display);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QVERIFY(plasmaVirtualDesktopManagementSpy.wait());
|
2021-08-29 05:11:06 +00:00
|
|
|
m_plasmaVirtualDesktopManagement = registry.createPlasmaVirtualDesktopManagement(plasmaVirtualDesktopManagementSpy.first().first().value<quint32>(),
|
|
|
|
plasmaVirtualDesktopManagementSpy.first().last().value<quint32>(),
|
|
|
|
this);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2020-12-09 20:13:19 +00:00
|
|
|
m_windowManagementInterface = new PlasmaWindowManagementInterface(m_display, m_display);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowManagementInterface->setPlasmaVirtualDesktopManagementInterface(m_plasmaVirtualDesktopManagementInterface);
|
|
|
|
|
|
|
|
QVERIFY(windowManagementSpy.wait());
|
2021-08-29 05:11:06 +00:00
|
|
|
m_windowManagement =
|
|
|
|
registry.createPlasmaWindowManagement(windowManagementSpy.first().first().value<quint32>(), windowManagementSpy.first().last().value<quint32>(), this);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy windowSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
2020-05-20 11:02:48 +00:00
|
|
|
m_windowInterface = m_windowManagementInterface->createWindow(this, QUuid::createUuid());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->setPid(1337);
|
|
|
|
|
|
|
|
QVERIFY(windowSpy.wait());
|
2022-11-08 21:15:17 +00:00
|
|
|
m_window = windowSpy.first().first().value<KWayland::Client::PlasmaWindow *>();
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::cleanup()
|
|
|
|
{
|
2022-04-19 10:14:26 +00:00
|
|
|
#define CLEANUP(variable) \
|
|
|
|
if (variable) { \
|
|
|
|
delete variable; \
|
|
|
|
variable = nullptr; \
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
}
|
|
|
|
CLEANUP(m_compositor)
|
|
|
|
CLEANUP(m_plasmaVirtualDesktopManagement)
|
2018-11-15 11:53:36 +00:00
|
|
|
CLEANUP(m_windowInterface)
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
CLEANUP(m_windowManagement)
|
|
|
|
CLEANUP(m_queue)
|
|
|
|
if (m_connection) {
|
|
|
|
m_connection->deleteLater();
|
|
|
|
m_connection = nullptr;
|
|
|
|
}
|
|
|
|
if (m_thread) {
|
|
|
|
m_thread->quit();
|
|
|
|
m_thread->wait();
|
|
|
|
delete m_thread;
|
|
|
|
m_thread = nullptr;
|
|
|
|
}
|
|
|
|
CLEANUP(m_compositorInterface)
|
|
|
|
CLEANUP(m_plasmaVirtualDesktopManagementInterface)
|
|
|
|
CLEANUP(m_windowManagementInterface)
|
|
|
|
CLEANUP(m_display)
|
|
|
|
#undef CLEANUP
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testCreate()
|
|
|
|
{
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy desktopCreatedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::desktopCreated);
|
|
|
|
QSignalSpy managementDoneSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::done);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// on this createDesktop bind() isn't called already, the desktopadded signals will be sent after bind happened
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-1"));
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktop1Int->setName("Desktop 1");
|
|
|
|
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopCreatedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QList<QVariant> arguments = desktopCreatedSpy.takeFirst();
|
|
|
|
QCOMPARE(arguments.at(0).toString(), QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(arguments.at(1).toUInt(), (quint32)0);
|
|
|
|
m_plasmaVirtualDesktopManagementInterface->sendDone();
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(managementDoneSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 1);
|
|
|
|
|
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first();
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy desktop1DoneSpy(desktop1, &KWayland::Client::PlasmaVirtualDesktop::done);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktop1Int->sendDone();
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktop1DoneSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(desktop1->id(), QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(desktop1->name(), QStringLiteral("Desktop 1"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// on those createDesktop the bind will already be done
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-2"));
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktop2Int->setName("Desktop 2");
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopCreatedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
arguments = desktopCreatedSpy.takeFirst();
|
|
|
|
QCOMPARE(arguments.at(0).toString(), QStringLiteral("0-2"));
|
|
|
|
QCOMPARE(arguments.at(1).toUInt(), (quint32)1);
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 2);
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktop3Int = m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-3"));
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktop3Int->setName("Desktop 3");
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopCreatedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
arguments = desktopCreatedSpy.takeFirst();
|
|
|
|
QCOMPARE(arguments.at(0).toString(), QStringLiteral("0-3"));
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 3);
|
|
|
|
|
|
|
|
m_plasmaVirtualDesktopManagementInterface->sendDone();
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(managementDoneSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// get the clients
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop2 = m_plasmaVirtualDesktopManagement->desktops()[1];
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy desktop2DoneSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::done);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktop2Int->sendDone();
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktop2DoneSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop3 = m_plasmaVirtualDesktopManagement->desktops()[2];
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy desktop3DoneSpy(desktop3, &KWayland::Client::PlasmaVirtualDesktop::done);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktop3Int->sendDone();
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktop3DoneSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(desktop1->id(), QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(desktop1->name(), QStringLiteral("Desktop 1"));
|
|
|
|
|
|
|
|
QCOMPARE(desktop2->id(), QStringLiteral("0-2"));
|
|
|
|
QCOMPARE(desktop2->name(), QStringLiteral("Desktop 2"));
|
|
|
|
|
|
|
|
QCOMPARE(desktop3->id(), QStringLiteral("0-3"));
|
|
|
|
QCOMPARE(desktop3->name(), QStringLiteral("Desktop 3"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// coherence of order between client and server
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().length(), 3);
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 3);
|
|
|
|
|
|
|
|
for (int i = 0; i < m_plasmaVirtualDesktopManagement->desktops().length(); ++i) {
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().at(i)->id(), m_plasmaVirtualDesktopManagement->desktops().at(i)->id());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-22 09:18:46 +00:00
|
|
|
void TestVirtualDesktop::testSetRows()
|
|
|
|
{
|
2021-08-29 05:11:06 +00:00
|
|
|
// rebuild some desktops
|
2019-01-22 09:18:46 +00:00
|
|
|
testCreate();
|
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy rowsChangedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::rowsChanged);
|
2019-01-22 09:18:46 +00:00
|
|
|
|
|
|
|
m_plasmaVirtualDesktopManagementInterface->setRows(3);
|
|
|
|
QVERIFY(rowsChangedSpy.wait());
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->rows(), 3);
|
|
|
|
}
|
|
|
|
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
void TestVirtualDesktop::testConnectNewClient()
|
|
|
|
{
|
2021-08-29 05:11:06 +00:00
|
|
|
// rebuild some desktops
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
testCreate();
|
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
KWayland::Client::Registry registry;
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QVERIFY(!registry.eventQueue());
|
|
|
|
registry.setEventQueue(m_queue);
|
|
|
|
QCOMPARE(registry.eventQueue(), m_queue);
|
|
|
|
registry.create(m_connection->display());
|
|
|
|
QVERIFY(registry.isValid());
|
|
|
|
registry.setup();
|
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy plasmaVirtualDesktopManagementSpy(®istry, &KWayland::Client::Registry::plasmaVirtualDesktopManagementAnnounced);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QVERIFY(plasmaVirtualDesktopManagementSpy.wait());
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
KWayland::Client::PlasmaVirtualDesktopManagement *otherPlasmaVirtualDesktopManagement =
|
|
|
|
registry.createPlasmaVirtualDesktopManagement(plasmaVirtualDesktopManagementSpy.first().first().value<quint32>(),
|
|
|
|
plasmaVirtualDesktopManagementSpy.first().last().value<quint32>(),
|
|
|
|
this);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy managementDoneSpy(otherPlasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::done);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(managementDoneSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(otherPlasmaVirtualDesktopManagement->desktops().length(), 3);
|
|
|
|
|
|
|
|
delete otherPlasmaVirtualDesktopManagement;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testDestroy()
|
|
|
|
{
|
2021-08-29 05:11:06 +00:00
|
|
|
// rebuild some desktops
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
testCreate();
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first();
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first();
|
|
|
|
|
|
|
|
QSignalSpy desktop1IntDestroyedSpy(desktop1Int, &QObject::destroyed);
|
|
|
|
QSignalSpy desktop1DestroyedSpy(desktop1, &QObject::destroyed);
|
|
|
|
QSignalSpy desktop1RemovedSpy(desktop1, &KWayland::Client::PlasmaVirtualDesktop::removed);
|
|
|
|
m_plasmaVirtualDesktopManagementInterface->removeDesktop(QStringLiteral("0-1"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// test that both server and client desktoip interfaces go away
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(!desktop1IntDestroyedSpy.isEmpty());
|
|
|
|
QVERIFY(desktop1RemovedSpy.wait());
|
|
|
|
QVERIFY(desktop1DestroyedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// coherence of order between client and server
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().length(), 2);
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 2);
|
|
|
|
|
|
|
|
for (int i = 0; i < m_plasmaVirtualDesktopManagement->desktops().length(); ++i) {
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().at(i)->id(), m_plasmaVirtualDesktopManagement->desktops().at(i)->id());
|
|
|
|
}
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// Test the desktopRemoved signal of the manager, remove another desktop as the signals can't be tested at the same time
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QSignalSpy desktopManagerRemovedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::desktopRemoved);
|
|
|
|
m_plasmaVirtualDesktopManagementInterface->removeDesktop(QStringLiteral("0-2"));
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopManagerRemovedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(desktopManagerRemovedSpy.takeFirst().at(0).toString(), QStringLiteral("0-2"));
|
|
|
|
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagementInterface->desktops().length(), 1);
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().length(), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testActivate()
|
|
|
|
{
|
2021-08-29 05:11:06 +00:00
|
|
|
// rebuild some desktops
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
testCreate();
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktop1Int = m_plasmaVirtualDesktopManagementInterface->desktops().first();
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop1 = m_plasmaVirtualDesktopManagement->desktops().first();
|
|
|
|
QVERIFY(desktop1->isActive());
|
|
|
|
QVERIFY(desktop1Int->isActive());
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktop2Int = m_plasmaVirtualDesktopManagementInterface->desktops()[1];
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop2 = m_plasmaVirtualDesktopManagement->desktops()[1];
|
|
|
|
QVERIFY(!desktop2Int->isActive());
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
QSignalSpy requestActivateSpy(desktop2Int, &KWin::PlasmaVirtualDesktopInterface::activateRequested);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QSignalSpy activatedSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::activated);
|
|
|
|
|
|
|
|
desktop2->requestActivate();
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(requestActivateSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// This simulates a compositor which supports only one active desktop at a time
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
for (auto *deskInt : m_plasmaVirtualDesktopManagementInterface->desktops()) {
|
|
|
|
if (deskInt->id() == desktop2->id()) {
|
|
|
|
deskInt->setActive(true);
|
|
|
|
} else {
|
|
|
|
deskInt->setActive(false);
|
|
|
|
}
|
|
|
|
}
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(activatedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// correct state in the server
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QVERIFY(desktop2Int->isActive());
|
|
|
|
QVERIFY(!desktop1Int->isActive());
|
2021-08-29 05:11:06 +00:00
|
|
|
// correct state in the client
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QVERIFY(desktop2Int->isActive());
|
|
|
|
QVERIFY(!desktop1Int->isActive());
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// Test the deactivated signal
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QSignalSpy deactivatedSpy(desktop2, &KWayland::Client::PlasmaVirtualDesktop::deactivated);
|
|
|
|
|
|
|
|
for (auto *deskInt : m_plasmaVirtualDesktopManagementInterface->desktops()) {
|
|
|
|
if (deskInt->id() == desktop1->id()) {
|
|
|
|
deskInt->setActive(true);
|
|
|
|
} else {
|
|
|
|
deskInt->setActive(false);
|
|
|
|
}
|
|
|
|
}
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(deactivatedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testEnterLeaveDesktop()
|
|
|
|
{
|
|
|
|
testCreate();
|
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
QSignalSpy enterRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::enterPlasmaVirtualDesktopRequested);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_window->requestEnterVirtualDesktop(QStringLiteral("0-1"));
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(enterRequestedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(enterRequestedSpy.takeFirst().at(0).toString(), QStringLiteral("0-1"));
|
|
|
|
|
|
|
|
QSignalSpy virtualDesktopEnteredSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopEntered);
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// agree to the request
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(m_windowInterface->plasmaVirtualDesktops().length(), 1);
|
|
|
|
QCOMPARE(m_windowInterface->plasmaVirtualDesktops().first(), QStringLiteral("0-1"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// check if the client received the enter
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopEnteredSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(virtualDesktopEnteredSpy.takeFirst().at(0).toString(), QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 1);
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().first(), QStringLiteral("0-1"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// add another desktop, server side
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-3"));
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopEnteredSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(virtualDesktopEnteredSpy.takeFirst().at(0).toString(), QStringLiteral("0-3"));
|
|
|
|
QCOMPARE(m_windowInterface->plasmaVirtualDesktops().length(), 2);
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2);
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops()[1], QStringLiteral("0-3"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// try to add an invalid desktop
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("invalid"));
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2);
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// remove a desktop
|
2023-09-13 17:59:29 +00:00
|
|
|
QSignalSpy leaveRequestedSpy(m_windowInterface, &KWin::PlasmaWindowInterface::leavePlasmaVirtualDesktopRequested);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_window->requestLeaveVirtualDesktop(QStringLiteral("0-1"));
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(leaveRequestedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(leaveRequestedSpy.takeFirst().at(0).toString(), QStringLiteral("0-1"));
|
|
|
|
|
|
|
|
QSignalSpy virtualDesktopLeftSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopLeft);
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// agree to the request
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->removePlasmaVirtualDesktop(QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(m_windowInterface->plasmaVirtualDesktops().length(), 1);
|
|
|
|
QCOMPARE(m_windowInterface->plasmaVirtualDesktops().first(), QStringLiteral("0-3"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// check if the client received the leave
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopLeftSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(virtualDesktopLeftSpy.takeFirst().at(0).toString(), QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 1);
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().first(), QStringLiteral("0-3"));
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// Destroy desktop 2
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_plasmaVirtualDesktopManagementInterface->removeDesktop(QStringLiteral("0-3"));
|
2021-08-29 05:11:06 +00:00
|
|
|
// the window should receive a left signal from the destroyed desktop
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopLeftSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testAllDesktops()
|
|
|
|
{
|
|
|
|
testCreate();
|
|
|
|
QSignalSpy virtualDesktopEnteredSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopEntered);
|
|
|
|
QSignalSpy virtualDesktopLeftSpy(m_window, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopLeft);
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// in the beginning the window is on desktop 1 and desktop 3
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-1"));
|
|
|
|
m_windowInterface->addPlasmaVirtualDesktop(QStringLiteral("0-3"));
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopEnteredSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// setting on all desktops
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 2);
|
|
|
|
m_windowInterface->setOnAllDesktops(true);
|
2021-08-29 05:11:06 +00:00
|
|
|
// setting on all desktops, the window will leave every desktop
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopLeftSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(virtualDesktopLeftSpy.count(), 2);
|
2018-11-15 11:53:50 +00:00
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 0);
|
|
|
|
QVERIFY(m_window->isOnAllDesktops());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 0);
|
|
|
|
QVERIFY(m_window->isOnAllDesktops());
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// return to the active desktop (0-1)
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_windowInterface->setOnAllDesktops(false);
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(virtualDesktopEnteredSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(m_window->plasmaVirtualDesktops().length(), 1);
|
|
|
|
QCOMPARE(m_windowInterface->plasmaVirtualDesktops().first(), QStringLiteral("0-1"));
|
|
|
|
QVERIFY(!m_window->isOnAllDesktops());
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testCreateRequested()
|
|
|
|
{
|
2021-08-29 05:11:06 +00:00
|
|
|
// rebuild some desktops
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
testCreate();
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
QSignalSpy desktopCreateRequestedSpy(m_plasmaVirtualDesktopManagementInterface,
|
2023-09-13 17:59:29 +00:00
|
|
|
&KWin::PlasmaVirtualDesktopManagementInterface::desktopCreateRequested);
|
2022-11-08 21:15:17 +00:00
|
|
|
QSignalSpy desktopCreatedSpy(m_plasmaVirtualDesktopManagement, &KWayland::Client::PlasmaVirtualDesktopManagement::desktopCreated);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// listen for createdRequested
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_plasmaVirtualDesktopManagement->requestCreateVirtualDesktop(QStringLiteral("Desktop"), 1);
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopCreateRequestedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(desktopCreateRequestedSpy.first().first().toString(), QStringLiteral("Desktop"));
|
2018-11-03 18:17:52 +00:00
|
|
|
QCOMPARE(desktopCreateRequestedSpy.first().at(1).toUInt(), (quint32)1);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// actually create
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_plasmaVirtualDesktopManagementInterface->createDesktop(QStringLiteral("0-4"), 1);
|
2023-09-13 17:59:29 +00:00
|
|
|
KWin::PlasmaVirtualDesktopInterface *desktopInt = m_plasmaVirtualDesktopManagementInterface->desktops().at(1);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
|
|
|
QCOMPARE(desktopInt->id(), QStringLiteral("0-4"));
|
|
|
|
desktopInt->setName(QStringLiteral("Desktop"));
|
|
|
|
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopCreatedSpy.wait());
|
2020-03-15 15:19:28 +00:00
|
|
|
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(desktopCreatedSpy.first().first().toString(), QStringLiteral("0-4"));
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().count(), 4);
|
|
|
|
|
2022-11-08 21:15:17 +00:00
|
|
|
KWayland::Client::PlasmaVirtualDesktop *desktop = m_plasmaVirtualDesktopManagement->desktops().at(1);
|
|
|
|
QSignalSpy desktopDoneSpy(desktop, &KWayland::Client::PlasmaVirtualDesktop::done);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
desktopInt->sendDone();
|
2021-08-29 05:11:06 +00:00
|
|
|
// desktopDoneSpy.wait();
|
|
|
|
// check the order is correct
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().at(0)->id(), QStringLiteral("0-1"));
|
|
|
|
QCOMPARE(desktop->id(), QStringLiteral("0-4"));
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().at(2)->id(), QStringLiteral("0-2"));
|
|
|
|
QCOMPARE(m_plasmaVirtualDesktopManagement->desktops().at(3)->id(), QStringLiteral("0-3"));
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestVirtualDesktop::testRemoveRequested()
|
|
|
|
{
|
2021-08-29 05:11:06 +00:00
|
|
|
// rebuild some desktops
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
testCreate();
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
QSignalSpy desktopRemoveRequestedSpy(m_plasmaVirtualDesktopManagementInterface,
|
2023-09-13 17:59:29 +00:00
|
|
|
&KWin::PlasmaVirtualDesktopManagementInterface::desktopRemoveRequested);
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
// request a remove, just check the request arrived, ignore the request.
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
m_plasmaVirtualDesktopManagement->requestRemoveVirtualDesktop(QStringLiteral("0-1"));
|
2023-04-21 11:54:50 +00:00
|
|
|
QVERIFY(desktopRemoveRequestedSpy.wait());
|
Add KWayland virtual desktop protocol
Summary:
Implement the virtual desktop protocol discussed in
T4457 xml protocol, client and server part.
The PlasmaVirtualDesktopManagement interface manages the desktops
instantiation and layout, each desktop is a PlasmaVirtualDesktop
instance which contains unique id, name and position.
PlasmaWindow has new events: plasmaVirtualDesktopEntered
and plasmaVirtualDesktopLeft when a window enters or leaves a desktop,
and desktops as the list of desktops is in. A window can be on
any subset of desktops, if the list is empty, it's considered on all desktops.
Test Plan: Autotest
Reviewers: #kwin, #plasma, graesslin, hein, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: davidedmundson, zzag, bshah, romangg, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D12820
2018-07-19 16:36:32 +00:00
|
|
|
QCOMPARE(desktopRemoveRequestedSpy.first().first().toString(), QStringLiteral("0-1"));
|
|
|
|
}
|
|
|
|
|
|
|
|
QTEST_GUILESS_MAIN(TestVirtualDesktop)
|
|
|
|
#include "test_plasma_virtual_desktop.moc"
|