2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2016-06-03 07:28:46 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
2016-06-03 07:28:46 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2016-06-03 07:28:46 +00:00
|
|
|
#include "kwin_wayland_test.h"
|
2022-03-23 10:13:38 +00:00
|
|
|
|
2022-08-29 07:55:49 +00:00
|
|
|
#include "core/output.h"
|
|
|
|
#include "core/platform.h"
|
2016-06-03 07:28:46 +00:00
|
|
|
#include "cursor.h"
|
2022-04-22 09:27:33 +00:00
|
|
|
#include "wayland/seat_interface.h"
|
2016-06-03 07:28:46 +00:00
|
|
|
#include "wayland_server.h"
|
|
|
|
#include "workspace.h"
|
2022-04-22 17:54:31 +00:00
|
|
|
#include "x11window.h"
|
2016-06-03 07:28:46 +00:00
|
|
|
#include <kwineffects.h>
|
|
|
|
|
|
|
|
#include <KWayland/Client/compositor.h>
|
|
|
|
#include <KWayland/Client/plasmawindowmanagement.h>
|
|
|
|
#include <KWayland/Client/surface.h>
|
2022-03-23 10:13:38 +00:00
|
|
|
// screenlocker
|
2022-02-28 18:58:35 +00:00
|
|
|
#if KWIN_BUILD_SCREENLOCKER
|
2016-06-03 13:27:36 +00:00
|
|
|
#include <KScreenLocker/KsldApp>
|
2022-02-23 13:27:05 +00:00
|
|
|
#endif
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QRasterWindow>
|
|
|
|
|
|
|
|
#include <netwm.h>
|
|
|
|
#include <xcb/xcb_icccm.h>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_plasma-window-0");
|
|
|
|
|
|
|
|
class PlasmaWindowTest : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
private Q_SLOTS:
|
|
|
|
void initTestCase();
|
|
|
|
void init();
|
|
|
|
void cleanup();
|
|
|
|
void testCreateDestroyX11PlasmaWindow();
|
|
|
|
void testInternalWindowNoPlasmaWindow();
|
|
|
|
void testPopupWindowNoPlasmaWindow();
|
2016-06-03 13:27:36 +00:00
|
|
|
void testLockScreenNoPlasmaWindow();
|
2016-06-03 14:53:23 +00:00
|
|
|
void testDestroyedButNotUnmapped();
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
private:
|
2022-11-07 21:33:00 +00:00
|
|
|
KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr;
|
2016-06-03 07:28:46 +00:00
|
|
|
KWayland::Client::Compositor *m_compositor = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
void PlasmaWindowTest::initTestCase()
|
|
|
|
{
|
2022-04-22 17:39:12 +00:00
|
|
|
qRegisterMetaType<KWin::Window *>();
|
2020-07-07 09:32:29 +00:00
|
|
|
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
|
2016-06-03 07:28:46 +00:00
|
|
|
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
|
2020-12-09 13:06:15 +00:00
|
|
|
QVERIFY(waylandServer()->init(s_socketName));
|
2019-08-26 21:16:53 +00:00
|
|
|
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
kwinApp()->start();
|
2020-07-07 09:32:29 +00:00
|
|
|
QVERIFY(applicationStartedSpy.wait());
|
2022-07-11 10:41:15 +00:00
|
|
|
const auto outputs = workspace()->outputs();
|
2021-08-31 07:03:05 +00:00
|
|
|
QCOMPARE(outputs.count(), 2);
|
|
|
|
QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024));
|
|
|
|
QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024));
|
2016-06-03 07:28:46 +00:00
|
|
|
setenv("QT_QPA_PLATFORM", "wayland", true);
|
2016-06-03 13:27:36 +00:00
|
|
|
setenv("QMLSCENE_DEVICE", "softwarecontext", true);
|
2016-06-03 07:28:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PlasmaWindowTest::init()
|
|
|
|
{
|
2016-12-03 13:31:14 +00:00
|
|
|
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::WindowManagement));
|
2016-06-30 11:32:54 +00:00
|
|
|
m_windowManagement = Test::waylandWindowManagement();
|
|
|
|
m_compositor = Test::waylandCompositor();
|
2016-06-03 07:28:46 +00:00
|
|
|
|
2021-08-28 18:58:29 +00:00
|
|
|
workspace()->setActiveOutput(QPoint(640, 512));
|
2020-04-02 16:18:01 +00:00
|
|
|
Cursors::self()->mouse()->setPos(QPoint(640, 512));
|
2016-06-03 07:28:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PlasmaWindowTest::cleanup()
|
|
|
|
{
|
2016-06-30 11:32:54 +00:00
|
|
|
Test::destroyWaylandConnection();
|
2016-06-03 07:28:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
|
|
|
|
{
|
2022-04-23 19:51:16 +00:00
|
|
|
// this test verifies that a PlasmaWindow gets unmapped on Client side when an X11 window is destroyed
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
// create an xcb window
|
|
|
|
struct XcbConnectionDeleter
|
|
|
|
{
|
2022-08-01 21:29:02 +00:00
|
|
|
void operator()(xcb_connection_t *pointer)
|
2016-06-03 07:28:46 +00:00
|
|
|
{
|
|
|
|
xcb_disconnect(pointer);
|
|
|
|
}
|
|
|
|
};
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
|
|
|
|
QVERIFY(!xcb_connection_has_error(c.get()));
|
2016-06-03 07:28:46 +00:00
|
|
|
const QRect windowGeometry(0, 0, 100, 200);
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_window_t windowId = xcb_generate_id(c.get());
|
|
|
|
xcb_create_window(c.get(), XCB_COPY_FROM_PARENT, windowId, rootWindow(),
|
2016-06-03 07:28:46 +00:00
|
|
|
windowGeometry.x(),
|
|
|
|
windowGeometry.y(),
|
|
|
|
windowGeometry.width(),
|
|
|
|
windowGeometry.height(),
|
|
|
|
0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, 0, nullptr);
|
|
|
|
xcb_size_hints_t hints;
|
|
|
|
memset(&hints, 0, sizeof(hints));
|
|
|
|
xcb_icccm_size_hints_set_position(&hints, 1, windowGeometry.x(), windowGeometry.y());
|
|
|
|
xcb_icccm_size_hints_set_size(&hints, 1, windowGeometry.width(), windowGeometry.height());
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_icccm_set_wm_normal_hints(c.get(), windowId, &hints);
|
|
|
|
xcb_map_window(c.get(), windowId);
|
|
|
|
xcb_flush(c.get());
|
2016-06-03 07:28:46 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// we should get a window for it
|
2022-04-23 08:33:23 +00:00
|
|
|
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
|
2016-06-03 07:28:46 +00:00
|
|
|
QVERIFY(windowCreatedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
|
|
|
|
QVERIFY(window);
|
|
|
|
QCOMPARE(window->window(), windowId);
|
|
|
|
QVERIFY(window->isDecorated());
|
|
|
|
QVERIFY(window->isActive());
|
2016-06-26 13:57:38 +00:00
|
|
|
// verify that it gets the keyboard focus
|
2022-04-23 19:51:16 +00:00
|
|
|
if (!window->surface()) {
|
2017-07-25 19:16:23 +00:00
|
|
|
// we don't have a surface yet, so focused keyboard surface if set is not ours
|
|
|
|
QVERIFY(!waylandServer()->seat()->focusedKeyboardSurface());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(Test::waitForWaylandSurface(window));
|
2017-07-25 19:16:23 +00:00
|
|
|
}
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(waylandServer()->seat()->focusedKeyboardSurface(), window->surface());
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
// now that should also give it to us on client side
|
|
|
|
QVERIFY(plasmaWindowCreatedSpy.wait());
|
|
|
|
QCOMPARE(plasmaWindowCreatedSpy.count(), 1);
|
|
|
|
QCOMPARE(m_windowManagement->windows().count(), 1);
|
2016-07-18 06:22:33 +00:00
|
|
|
auto pw = m_windowManagement->windows().first();
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(pw->geometry(), window->frameGeometry());
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy geometryChangedSpy(pw, &KWayland::Client::PlasmaWindow::geometryChanged);
|
2016-06-03 07:28:46 +00:00
|
|
|
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy unmappedSpy(m_windowManagement->windows().first(), &KWayland::Client::PlasmaWindow::unmapped);
|
2016-06-03 07:28:46 +00:00
|
|
|
QSignalSpy destroyedSpy(m_windowManagement->windows().first(), &QObject::destroyed);
|
|
|
|
|
|
|
|
// now shade the window
|
2022-05-16 20:13:39 +00:00
|
|
|
const QRectF geoBeforeShade = window->frameGeometry();
|
2016-06-03 07:28:46 +00:00
|
|
|
QVERIFY(geoBeforeShade.isValid());
|
|
|
|
QVERIFY(!geoBeforeShade.isEmpty());
|
|
|
|
workspace()->slotWindowShade();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(window->isShade());
|
|
|
|
QVERIFY(window->frameGeometry() != geoBeforeShade);
|
2016-07-18 06:22:33 +00:00
|
|
|
QVERIFY(geometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(pw->geometry(), window->frameGeometry());
|
2016-06-03 07:28:46 +00:00
|
|
|
// and unshade again
|
|
|
|
workspace()->slotWindowShade();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!window->isShade());
|
|
|
|
QCOMPARE(window->frameGeometry(), geoBeforeShade);
|
2016-07-18 06:22:33 +00:00
|
|
|
QVERIFY(geometryChangedSpy.wait());
|
|
|
|
QCOMPARE(pw->geometry(), geoBeforeShade);
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
// and destroy the window again
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_unmap_window(c.get(), windowId);
|
|
|
|
xcb_flush(c.get());
|
2016-06-03 07:28:46 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
|
2016-06-03 07:28:46 +00:00
|
|
|
QVERIFY(windowClosedSpy.wait());
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_destroy_window(c.get(), windowId);
|
2016-06-03 07:28:46 +00:00
|
|
|
c.reset();
|
|
|
|
|
|
|
|
QVERIFY(unmappedSpy.wait());
|
|
|
|
QCOMPARE(unmappedSpy.count(), 1);
|
|
|
|
|
|
|
|
QVERIFY(destroyedSpy.wait());
|
|
|
|
}
|
|
|
|
|
|
|
|
class HelperWindow : public QRasterWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
HelperWindow();
|
Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 16:52:26 +00:00
|
|
|
~HelperWindow() override;
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
HelperWindow::HelperWindow()
|
|
|
|
: QRasterWindow(nullptr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
HelperWindow::~HelperWindow() = default;
|
|
|
|
|
|
|
|
void HelperWindow::paintEvent(QPaintEvent *event)
|
|
|
|
{
|
|
|
|
QPainter p(this);
|
|
|
|
p.fillRect(0, 0, width(), height(), Qt::red);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PlasmaWindowTest::testInternalWindowNoPlasmaWindow()
|
|
|
|
{
|
2022-04-23 19:51:16 +00:00
|
|
|
// this test verifies that an internal window is not added as a PlasmaWindow
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
2016-06-03 07:28:46 +00:00
|
|
|
HelperWindow win;
|
|
|
|
win.setGeometry(0, 0, 100, 100);
|
|
|
|
win.show();
|
|
|
|
|
|
|
|
QVERIFY(!plasmaWindowCreatedSpy.wait());
|
|
|
|
}
|
|
|
|
|
|
|
|
void PlasmaWindowTest::testPopupWindowNoPlasmaWindow()
|
|
|
|
{
|
2022-04-23 19:51:16 +00:00
|
|
|
// this test verifies that a popup window is not added as a PlasmaWindow
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
// first create the parent window
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
|
|
|
std::unique_ptr<Test::XdgToplevel> parentShellSurface(Test::createXdgToplevelSurface(parentSurface.get()));
|
|
|
|
Window *parentClient = Test::renderAndWaitForShown(parentSurface.get(), QSize(100, 50), Qt::blue);
|
2019-08-27 15:01:14 +00:00
|
|
|
QVERIFY(parentClient);
|
2016-06-03 07:28:46 +00:00
|
|
|
QVERIFY(plasmaWindowCreatedSpy.wait());
|
2019-08-27 15:01:14 +00:00
|
|
|
QCOMPARE(plasmaWindowCreatedSpy.count(), 1);
|
2016-06-03 07:28:46 +00:00
|
|
|
|
|
|
|
// now let's create a popup window for it
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<Test::XdgPositioner> positioner(Test::createXdgPositioner());
|
2021-05-11 05:26:51 +00:00
|
|
|
positioner->set_size(10, 10);
|
|
|
|
positioner->set_anchor_rect(0, 0, 10, 10);
|
|
|
|
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
|
|
|
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<KWayland::Client::Surface> popupSurface(Test::createSurface());
|
|
|
|
std::unique_ptr<Test::XdgPopup> popupShellSurface(Test::createXdgPopupSurface(popupSurface.get(), parentShellSurface->xdgSurface(), positioner.get()));
|
|
|
|
Window *popupWindow = Test::renderAndWaitForShown(popupSurface.get(), QSize(10, 10), Qt::blue);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(popupWindow);
|
2019-08-27 15:01:14 +00:00
|
|
|
QVERIFY(!plasmaWindowCreatedSpy.wait(100));
|
|
|
|
QCOMPARE(plasmaWindowCreatedSpy.count(), 1);
|
2016-06-03 13:27:36 +00:00
|
|
|
|
|
|
|
// let's destroy the windows
|
|
|
|
popupShellSurface.reset();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(Test::waitForWindowDestroyed(popupWindow));
|
2016-06-03 13:27:36 +00:00
|
|
|
parentShellSurface.reset();
|
2019-08-27 15:01:14 +00:00
|
|
|
QVERIFY(Test::waitForWindowDestroyed(parentClient));
|
2016-06-03 13:27:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PlasmaWindowTest::testLockScreenNoPlasmaWindow()
|
|
|
|
{
|
2022-02-28 18:58:35 +00:00
|
|
|
#if KWIN_BUILD_SCREENLOCKER
|
2016-06-03 13:27:36 +00:00
|
|
|
// this test verifies that lock screen windows are not exposed to PlasmaWindow
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
2016-06-03 13:27:36 +00:00
|
|
|
|
2019-08-30 21:36:58 +00:00
|
|
|
// this time we use a QSignalSpy on XdgShellClient as it'a a little bit more complex setup
|
2022-04-23 08:33:23 +00:00
|
|
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
2016-06-03 13:27:36 +00:00
|
|
|
// lock
|
|
|
|
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate);
|
2022-04-23 08:33:23 +00:00
|
|
|
QVERIFY(windowAddedSpy.wait());
|
|
|
|
QVERIFY(windowAddedSpy.first().first().value<Window *>()->isLockScreen());
|
2022-04-23 19:51:16 +00:00
|
|
|
// should not be sent to the window
|
2016-06-03 13:27:36 +00:00
|
|
|
QVERIFY(plasmaWindowCreatedSpy.isEmpty());
|
|
|
|
QVERIFY(!plasmaWindowCreatedSpy.wait());
|
|
|
|
|
|
|
|
// fake unlock
|
|
|
|
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged);
|
|
|
|
const auto children = ScreenLocker::KSldApp::self()->children();
|
|
|
|
for (auto it = children.begin(); it != children.end(); ++it) {
|
|
|
|
if (qstrcmp((*it)->metaObject()->className(), "LogindIntegration") != 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
QMetaObject::invokeMethod(*it, "requestUnlock");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
QVERIFY(lockStateChangedSpy.wait());
|
|
|
|
QVERIFY(!waylandServer()->isScreenLocked());
|
2022-02-23 13:27:05 +00:00
|
|
|
#else
|
|
|
|
QSKIP("KWin was built without lockscreen support");
|
|
|
|
#endif
|
2016-06-03 07:28:46 +00:00
|
|
|
}
|
|
|
|
|
2016-06-03 14:53:23 +00:00
|
|
|
void PlasmaWindowTest::testDestroyedButNotUnmapped()
|
|
|
|
{
|
|
|
|
// this test verifies that also when a ShellSurface gets destroyed without a prior unmap
|
|
|
|
// the PlasmaWindow gets destroyed on Client side
|
2022-11-07 21:33:00 +00:00
|
|
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
2016-06-03 14:53:23 +00:00
|
|
|
|
|
|
|
// first create the parent window
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
|
|
|
std::unique_ptr<Test::XdgToplevel> parentShellSurface(Test::createXdgToplevelSurface(parentSurface.get()));
|
2016-06-03 14:53:23 +00:00
|
|
|
// map that window
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(parentSurface.get(), QSize(100, 50), Qt::blue);
|
2016-06-03 14:53:23 +00:00
|
|
|
// this should create a plasma window
|
|
|
|
QVERIFY(plasmaWindowCreatedSpy.wait());
|
|
|
|
QCOMPARE(plasmaWindowCreatedSpy.count(), 1);
|
2022-11-07 21:33:00 +00:00
|
|
|
auto window = plasmaWindowCreatedSpy.first().first().value<KWayland::Client::PlasmaWindow *>();
|
2016-06-03 14:53:23 +00:00
|
|
|
QVERIFY(window);
|
|
|
|
QSignalSpy destroyedSpy(window, &QObject::destroyed);
|
|
|
|
|
|
|
|
// now destroy without an unmap
|
|
|
|
parentShellSurface.reset();
|
|
|
|
parentSurface.reset();
|
|
|
|
QVERIFY(destroyedSpy.wait());
|
|
|
|
}
|
|
|
|
|
2016-06-03 07:28:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
WAYLANDTEST_MAIN(KWin::PlasmaWindowTest)
|
|
|
|
#include "plasmawindow_test.moc"
|