2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2016-10-30 10:27:38 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
2016-10-30 10:27:38 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2016-10-30 10:27:38 +00:00
|
|
|
#include "composite.h"
|
2022-08-29 07:55:49 +00:00
|
|
|
#include "core/platform.h"
|
|
|
|
#include "core/renderbackend.h"
|
2022-03-23 10:13:38 +00:00
|
|
|
#include "cursor.h"
|
2018-09-24 13:40:26 +00:00
|
|
|
#include "deleted.h"
|
2016-10-30 10:27:38 +00:00
|
|
|
#include "effectloader.h"
|
2022-03-23 10:13:38 +00:00
|
|
|
#include "effects.h"
|
|
|
|
#include "kwin_wayland_test.h"
|
2016-10-30 10:27:38 +00:00
|
|
|
#include "wayland_server.h"
|
|
|
|
#include "workspace.h"
|
2022-04-22 17:54:31 +00:00
|
|
|
#include "x11window.h"
|
2016-10-30 10:27:38 +00:00
|
|
|
|
|
|
|
#include <KConfigGroup>
|
|
|
|
|
2016-10-31 07:43:35 +00:00
|
|
|
#include <KWayland/Client/connection_thread.h>
|
|
|
|
#include <KWayland/Client/registry.h>
|
|
|
|
#include <KWayland/Client/slide.h>
|
2022-03-23 10:13:38 +00:00
|
|
|
#include <KWayland/Client/surface.h>
|
2016-10-31 07:43:35 +00:00
|
|
|
|
2016-10-30 10:27:38 +00:00
|
|
|
#include <netwm.h>
|
|
|
|
#include <xcb/xcb_icccm.h>
|
|
|
|
|
|
|
|
using namespace KWin;
|
|
|
|
static const QString s_socketName = QStringLiteral("wayland_test_effects_slidingpopups-0");
|
|
|
|
|
|
|
|
class SlidingPopupsTest : public QObject
|
|
|
|
{
|
2022-03-23 10:13:38 +00:00
|
|
|
Q_OBJECT
|
2016-10-30 10:27:38 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void initTestCase();
|
|
|
|
void init();
|
|
|
|
void cleanup();
|
|
|
|
|
|
|
|
void testWithOtherEffect_data();
|
|
|
|
void testWithOtherEffect();
|
2016-10-31 07:43:35 +00:00
|
|
|
void testWithOtherEffectWayland_data();
|
|
|
|
void testWithOtherEffectWayland();
|
2016-10-30 10:27:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void SlidingPopupsTest::initTestCase()
|
|
|
|
{
|
2018-11-07 09:51:07 +00:00
|
|
|
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
|
2022-04-22 17:39:12 +00:00
|
|
|
qRegisterMetaType<KWin::Window *>();
|
2022-03-23 10:13:38 +00:00
|
|
|
qRegisterMetaType<KWin::Deleted *>();
|
|
|
|
qRegisterMetaType<KWin::Effect *>();
|
2020-07-07 09:32:29 +00:00
|
|
|
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
|
2016-10-30 10:27:38 +00:00
|
|
|
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
|
2020-12-09 13:06:15 +00:00
|
|
|
QVERIFY(waylandServer()->init(s_socketName));
|
2022-09-16 08:42:55 +00:00
|
|
|
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
|
2016-10-30 10:27:38 +00:00
|
|
|
|
|
|
|
// disable all effects - we don't want to have it interact with the rendering
|
|
|
|
auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig);
|
|
|
|
KConfigGroup plugins(config, QStringLiteral("Plugins"));
|
2021-10-09 15:38:14 +00:00
|
|
|
const auto builtinNames = EffectLoader().listOfKnownEffects();
|
2016-10-30 10:27:38 +00:00
|
|
|
for (QString name : builtinNames) {
|
|
|
|
plugins.writeEntry(name + QStringLiteral("Enabled"), false);
|
|
|
|
}
|
2016-12-02 19:27:43 +00:00
|
|
|
KConfigGroup wobblyGroup = config->group("Effect-Wobbly");
|
|
|
|
wobblyGroup.writeEntry(QStringLiteral("Settings"), QStringLiteral("Custom"));
|
|
|
|
wobblyGroup.writeEntry(QStringLiteral("OpenEffect"), true);
|
|
|
|
wobblyGroup.writeEntry(QStringLiteral("CloseEffect"), true);
|
2016-10-30 10:27:38 +00:00
|
|
|
|
|
|
|
config->sync();
|
|
|
|
kwinApp()->setConfig(config);
|
|
|
|
|
2019-01-06 15:34:10 +00:00
|
|
|
qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2"));
|
2016-10-30 10:27:38 +00:00
|
|
|
qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1");
|
|
|
|
kwinApp()->start();
|
2020-07-07 09:32:29 +00:00
|
|
|
QVERIFY(applicationStartedSpy.wait());
|
2016-10-30 10:27:38 +00:00
|
|
|
QVERIFY(Compositor::self());
|
2019-01-06 15:34:10 +00:00
|
|
|
|
2021-11-10 10:34:18 +00:00
|
|
|
QCOMPARE(Compositor::self()->backend()->compositingType(), KWin::OpenGLCompositing);
|
2016-10-30 10:27:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlidingPopupsTest::init()
|
|
|
|
{
|
2016-12-03 13:31:14 +00:00
|
|
|
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration));
|
2016-10-30 10:27:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlidingPopupsTest::cleanup()
|
|
|
|
{
|
2016-10-31 07:43:35 +00:00
|
|
|
Test::destroyWaylandConnection();
|
2022-03-23 10:13:38 +00:00
|
|
|
EffectsHandlerImpl *e = static_cast<EffectsHandlerImpl *>(effects);
|
2016-10-30 10:27:38 +00:00
|
|
|
while (!e->loadedEffects().isEmpty()) {
|
|
|
|
const QString effect = e->loadedEffects().first();
|
|
|
|
e->unloadEffect(effect);
|
|
|
|
QVERIFY(!e->isEffectLoaded(effect));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct XcbConnectionDeleter
|
|
|
|
{
|
2022-08-01 21:29:02 +00:00
|
|
|
void operator()(xcb_connection_t *pointer)
|
2016-10-30 10:27:38 +00:00
|
|
|
{
|
|
|
|
xcb_disconnect(pointer);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void SlidingPopupsTest::testWithOtherEffect_data()
|
|
|
|
{
|
|
|
|
QTest::addColumn<QStringList>("effectsToLoad");
|
|
|
|
|
2016-10-31 06:47:26 +00:00
|
|
|
QTest::newRow("fade, slide") << QStringList{QStringLiteral("kwin4_effect_fade"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, fade") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_fade")};
|
2018-10-27 21:27:25 +00:00
|
|
|
QTest::newRow("scale, slide") << QStringList{QStringLiteral("kwin4_effect_scale"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, scale") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_scale")};
|
2016-10-31 06:47:26 +00:00
|
|
|
|
|
|
|
if (effects->compositingType() & KWin::OpenGLCompositing) {
|
|
|
|
QTest::newRow("glide, slide") << QStringList{QStringLiteral("glide"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, glide") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("glide")};
|
|
|
|
QTest::newRow("wobblywindows, slide") << QStringList{QStringLiteral("wobblywindows"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, wobblywindows") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("wobblywindows")};
|
|
|
|
QTest::newRow("fallapart, slide") << QStringList{QStringLiteral("fallapart"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, fallapart") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("fallapart")};
|
|
|
|
}
|
2016-10-30 10:27:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SlidingPopupsTest::testWithOtherEffect()
|
|
|
|
{
|
|
|
|
// this test verifies that slidingpopups effect grabs the window added role
|
|
|
|
// independently of the sequence how the effects are loaded.
|
|
|
|
// see BUG 336866
|
2022-03-23 10:13:38 +00:00
|
|
|
EffectsHandlerImpl *e = static_cast<EffectsHandlerImpl *>(effects);
|
2016-10-30 10:27:38 +00:00
|
|
|
// find the effectsloader
|
2022-03-23 10:13:38 +00:00
|
|
|
auto effectloader = e->findChild<AbstractEffectLoader *>();
|
2016-10-30 10:27:38 +00:00
|
|
|
QVERIFY(effectloader);
|
|
|
|
QSignalSpy effectLoadedSpy(effectloader, &AbstractEffectLoader::effectLoaded);
|
|
|
|
|
|
|
|
Effect *slidingPoupus = nullptr;
|
|
|
|
Effect *otherEffect = nullptr;
|
|
|
|
QFETCH(QStringList, effectsToLoad);
|
|
|
|
for (const QString &effectName : effectsToLoad) {
|
|
|
|
QVERIFY(!e->isEffectLoaded(effectName));
|
|
|
|
QVERIFY(e->loadEffect(effectName));
|
|
|
|
QVERIFY(e->isEffectLoaded(effectName));
|
|
|
|
|
|
|
|
QCOMPARE(effectLoadedSpy.count(), 1);
|
2022-03-23 10:13:38 +00:00
|
|
|
Effect *effect = effectLoadedSpy.first().first().value<Effect *>();
|
2016-10-30 10:27:38 +00:00
|
|
|
if (effectName == QStringLiteral("slidingpopups")) {
|
|
|
|
slidingPoupus = effect;
|
|
|
|
} else {
|
|
|
|
otherEffect = effect;
|
|
|
|
}
|
|
|
|
effectLoadedSpy.clear();
|
|
|
|
}
|
|
|
|
QVERIFY(slidingPoupus);
|
|
|
|
QVERIFY(otherEffect);
|
|
|
|
|
|
|
|
QVERIFY(!slidingPoupus->isActive());
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
2016-10-31 07:55:54 +00:00
|
|
|
|
|
|
|
// give the compositor some time to render
|
|
|
|
QTest::qWait(50);
|
|
|
|
|
2016-10-30 10:27:38 +00:00
|
|
|
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
|
|
|
|
|
|
|
|
// create an xcb window
|
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-10-30 10:27:38 +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-10-30 10:27:38 +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);
|
|
|
|
NETWinInfo winInfo(c.get(), windowId, rootWindow(), NET::Properties(), NET::Properties2());
|
2016-10-31 06:47:26 +00:00
|
|
|
winInfo.setWindowType(NET::Normal);
|
2016-10-30 10:27:38 +00:00
|
|
|
|
|
|
|
// and get the slide atom
|
|
|
|
const QByteArray effectAtomName = QByteArrayLiteral("_KDE_SLIDE");
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_intern_atom_cookie_t atomCookie = xcb_intern_atom_unchecked(c.get(), false, effectAtomName.length(), effectAtomName.constData());
|
2016-10-30 10:27:38 +00:00
|
|
|
const int size = 2;
|
|
|
|
int32_t data[size];
|
|
|
|
data[0] = 0;
|
|
|
|
data[1] = 0;
|
2022-08-01 21:29:02 +00:00
|
|
|
UniqueCPtr<xcb_intern_atom_reply_t> atom(xcb_intern_atom_reply(c.get(), atomCookie, nullptr));
|
|
|
|
QVERIFY(atom != nullptr);
|
|
|
|
xcb_change_property(c.get(), XCB_PROP_MODE_REPLACE, windowId, atom->atom, atom->atom, 32, size, data);
|
2016-10-30 10:27:38 +00:00
|
|
|
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_map_window(c.get(), windowId);
|
|
|
|
xcb_flush(c.get());
|
2016-10-30 10:27:38 +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-10-30 10:27:38 +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->isNormalWindow());
|
2016-10-30 10:27:38 +00:00
|
|
|
|
|
|
|
// sliding popups should be active
|
|
|
|
QVERIFY(windowAddedSpy.wait());
|
|
|
|
QTRY_VERIFY(slidingPoupus->isActive());
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
|
|
|
|
// wait till effect ends
|
|
|
|
QTRY_VERIFY(!slidingPoupus->isActive());
|
2016-10-31 06:47:26 +00:00
|
|
|
QTest::qWait(300);
|
2016-10-30 10:27:38 +00:00
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
|
|
|
|
// and destroy the window again
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_unmap_window(c.get(), windowId);
|
|
|
|
xcb_flush(c.get());
|
2016-10-30 10:27:38 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
|
2016-10-30 10:27:38 +00:00
|
|
|
|
|
|
|
QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted);
|
|
|
|
QVERIFY(windowClosedSpy.wait());
|
|
|
|
|
|
|
|
// again we should have the sliding popups active
|
|
|
|
QVERIFY(slidingPoupus->isActive());
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
|
|
|
|
QVERIFY(windowDeletedSpy.wait());
|
|
|
|
|
|
|
|
QCOMPARE(windowDeletedSpy.count(), 1);
|
|
|
|
QTRY_VERIFY(!slidingPoupus->isActive());
|
2016-10-31 06:47:26 +00:00
|
|
|
QTest::qWait(300);
|
2016-10-30 10:27:38 +00:00
|
|
|
QVERIFY(!otherEffect->isActive());
|
2022-08-01 21:29:02 +00:00
|
|
|
xcb_destroy_window(c.get(), windowId);
|
2016-10-30 10:27:38 +00:00
|
|
|
c.reset();
|
|
|
|
}
|
|
|
|
|
2016-10-31 07:43:35 +00:00
|
|
|
void SlidingPopupsTest::testWithOtherEffectWayland_data()
|
|
|
|
{
|
|
|
|
QTest::addColumn<QStringList>("effectsToLoad");
|
|
|
|
|
|
|
|
QTest::newRow("fade, slide") << QStringList{QStringLiteral("kwin4_effect_fade"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, fade") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_fade")};
|
2018-10-27 21:27:25 +00:00
|
|
|
QTest::newRow("scale, slide") << QStringList{QStringLiteral("kwin4_effect_scale"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, scale") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("kwin4_effect_scale")};
|
2016-10-31 07:43:35 +00:00
|
|
|
|
|
|
|
if (effects->compositingType() & KWin::OpenGLCompositing) {
|
|
|
|
QTest::newRow("glide, slide") << QStringList{QStringLiteral("glide"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, glide") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("glide")};
|
|
|
|
QTest::newRow("wobblywindows, slide") << QStringList{QStringLiteral("wobblywindows"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, wobblywindows") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("wobblywindows")};
|
|
|
|
QTest::newRow("fallapart, slide") << QStringList{QStringLiteral("fallapart"), QStringLiteral("slidingpopups")};
|
|
|
|
QTest::newRow("slide, fallapart") << QStringList{QStringLiteral("slidingpopups"), QStringLiteral("fallapart")};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SlidingPopupsTest::testWithOtherEffectWayland()
|
|
|
|
{
|
|
|
|
// this test verifies that slidingpopups effect grabs the window added role
|
|
|
|
// independently of the sequence how the effects are loaded.
|
|
|
|
// see BUG 336866
|
|
|
|
// the test is like testWithOtherEffect, but simulates using a Wayland window
|
2022-03-23 10:13:38 +00:00
|
|
|
EffectsHandlerImpl *e = static_cast<EffectsHandlerImpl *>(effects);
|
2016-10-31 07:43:35 +00:00
|
|
|
// find the effectsloader
|
2022-03-23 10:13:38 +00:00
|
|
|
auto effectloader = e->findChild<AbstractEffectLoader *>();
|
2016-10-31 07:43:35 +00:00
|
|
|
QVERIFY(effectloader);
|
|
|
|
QSignalSpy effectLoadedSpy(effectloader, &AbstractEffectLoader::effectLoaded);
|
|
|
|
|
|
|
|
Effect *slidingPoupus = nullptr;
|
|
|
|
Effect *otherEffect = nullptr;
|
|
|
|
QFETCH(QStringList, effectsToLoad);
|
|
|
|
for (const QString &effectName : effectsToLoad) {
|
|
|
|
QVERIFY(!e->isEffectLoaded(effectName));
|
|
|
|
QVERIFY(e->loadEffect(effectName));
|
|
|
|
QVERIFY(e->isEffectLoaded(effectName));
|
|
|
|
|
|
|
|
QCOMPARE(effectLoadedSpy.count(), 1);
|
2022-03-23 10:13:38 +00:00
|
|
|
Effect *effect = effectLoadedSpy.first().first().value<Effect *>();
|
2016-10-31 07:43:35 +00:00
|
|
|
if (effectName == QStringLiteral("slidingpopups")) {
|
|
|
|
slidingPoupus = effect;
|
|
|
|
} else {
|
|
|
|
otherEffect = effect;
|
|
|
|
}
|
|
|
|
effectLoadedSpy.clear();
|
|
|
|
}
|
|
|
|
QVERIFY(slidingPoupus);
|
|
|
|
QVERIFY(otherEffect);
|
|
|
|
|
|
|
|
QVERIFY(!slidingPoupus->isActive());
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
|
|
|
|
|
|
|
|
using namespace KWayland::Client;
|
|
|
|
// the test created the slide protocol, let's create a Registry and listen for it
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<Registry> registry(new Registry);
|
2016-10-31 07:43:35 +00:00
|
|
|
registry->create(Test::waylandConnection());
|
|
|
|
|
2022-08-01 21:29:02 +00:00
|
|
|
QSignalSpy interfacesAnnouncedSpy(registry.get(), &Registry::interfacesAnnounced);
|
2016-10-31 07:43:35 +00:00
|
|
|
registry->setup();
|
|
|
|
QVERIFY(interfacesAnnouncedSpy.wait());
|
|
|
|
auto slideInterface = registry->interface(Registry::Interface::Slide);
|
|
|
|
QVERIFY(slideInterface.name != 0);
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<SlideManager> slideManager(registry->createSlideManager(slideInterface.name, slideInterface.version));
|
2016-10-31 07:43:35 +00:00
|
|
|
QVERIFY(slideManager);
|
|
|
|
|
|
|
|
// create Wayland window
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
2016-10-31 07:43:35 +00:00
|
|
|
QVERIFY(surface);
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<Slide> slide(slideManager->createSlide(surface.get()));
|
2016-10-31 07:43:35 +00:00
|
|
|
slide->setLocation(Slide::Location::Left);
|
|
|
|
slide->commit();
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
2016-10-31 07:43:35 +00:00
|
|
|
QVERIFY(shellSurface);
|
|
|
|
QCOMPARE(windowAddedSpy.count(), 0);
|
2022-08-01 21:29:02 +00:00
|
|
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(10, 20), Qt::blue);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(window->isNormalWindow());
|
2016-10-31 07:43:35 +00:00
|
|
|
|
|
|
|
// sliding popups should be active
|
|
|
|
QCOMPARE(windowAddedSpy.count(), 1);
|
|
|
|
QTRY_VERIFY(slidingPoupus->isActive());
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
|
|
|
|
// wait till effect ends
|
|
|
|
QTRY_VERIFY(!slidingPoupus->isActive());
|
|
|
|
QTest::qWait(300);
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
|
|
|
|
// and destroy the window again
|
|
|
|
shellSurface.reset();
|
|
|
|
surface.reset();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
|
2016-10-31 07:43:35 +00:00
|
|
|
|
|
|
|
QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted);
|
|
|
|
QVERIFY(windowClosedSpy.wait());
|
|
|
|
|
|
|
|
// again we should have the sliding popups active
|
|
|
|
QVERIFY(slidingPoupus->isActive());
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
|
|
|
|
QVERIFY(windowDeletedSpy.wait());
|
|
|
|
|
|
|
|
QCOMPARE(windowDeletedSpy.count(), 1);
|
|
|
|
QTRY_VERIFY(!slidingPoupus->isActive());
|
|
|
|
QTest::qWait(300);
|
|
|
|
QVERIFY(!otherEffect->isActive());
|
|
|
|
}
|
|
|
|
|
2016-10-30 10:27:38 +00:00
|
|
|
WAYLANDTEST_MAIN(SlidingPopupsTest)
|
|
|
|
#include "slidingpopups_test.moc"
|