autotests: Reduce the number of "using namespace KWayland::Client"
KWayland::Client has ambiguous type names such as "Compositor" or "Output". Use full types to improve code readability.
This commit is contained in:
parent
a81147837d
commit
482741499d
45 changed files with 256 additions and 405 deletions
|
@ -80,8 +80,6 @@ void ActivationTest::testSwitchToWindowToLeft()
|
||||||
{
|
{
|
||||||
// This test verifies that "Switch to Window to the Left" shortcut works.
|
// This test verifies that "Switch to Window to the Left" shortcut works.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Prepare the test environment.
|
// Prepare the test environment.
|
||||||
stackScreensHorizontally();
|
stackScreensHorizontally();
|
||||||
|
|
||||||
|
@ -148,8 +146,6 @@ void ActivationTest::testSwitchToWindowToRight()
|
||||||
{
|
{
|
||||||
// This test verifies that "Switch to Window to the Right" shortcut works.
|
// This test verifies that "Switch to Window to the Right" shortcut works.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Prepare the test environment.
|
// Prepare the test environment.
|
||||||
stackScreensHorizontally();
|
stackScreensHorizontally();
|
||||||
|
|
||||||
|
@ -216,8 +212,6 @@ void ActivationTest::testSwitchToWindowAbove()
|
||||||
{
|
{
|
||||||
// This test verifies that "Switch to Window Above" shortcut works.
|
// This test verifies that "Switch to Window Above" shortcut works.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Prepare the test environment.
|
// Prepare the test environment.
|
||||||
stackScreensVertically();
|
stackScreensVertically();
|
||||||
|
|
||||||
|
@ -284,8 +278,6 @@ void ActivationTest::testSwitchToWindowBelow()
|
||||||
{
|
{
|
||||||
// This test verifies that "Switch to Window Bottom" shortcut works.
|
// This test verifies that "Switch to Window Bottom" shortcut works.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Prepare the test environment.
|
// Prepare the test environment.
|
||||||
stackScreensVertically();
|
stackScreensVertically();
|
||||||
|
|
||||||
|
@ -353,8 +345,6 @@ void ActivationTest::testSwitchToWindowMaximized()
|
||||||
// This test verifies that we switch to the top-most maximized window, i.e.
|
// This test verifies that we switch to the top-most maximized window, i.e.
|
||||||
// the one that user sees at the moment. See bug 411356.
|
// the one that user sees at the moment. See bug 411356.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Prepare the test environment.
|
// Prepare the test environment.
|
||||||
stackScreensHorizontally();
|
stackScreensHorizontally();
|
||||||
|
|
||||||
|
@ -438,8 +428,6 @@ void ActivationTest::testSwitchToWindowFullScreen()
|
||||||
// This test verifies that we switch to the top-most fullscreen window, i.e.
|
// This test verifies that we switch to the top-most fullscreen window, i.e.
|
||||||
// the one that user sees at the moment. See bug 411356.
|
// the one that user sees at the moment. See bug 411356.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Prepare the test environment.
|
// Prepare the test environment.
|
||||||
stackScreensVertically();
|
stackScreensVertically();
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,6 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
|
||||||
{
|
{
|
||||||
// This test verifies that an SHM buffer size change is handled correctly
|
// This test verifies that an SHM buffer size change is handled correctly
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -72,8 +70,6 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
|
||||||
|
|
||||||
void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
|
void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// setup parent surface
|
// setup parent surface
|
||||||
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
||||||
QVERIFY(parentSurface != nullptr);
|
QVERIFY(parentSurface != nullptr);
|
||||||
|
@ -83,7 +79,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
|
||||||
// setup sub surface
|
// setup sub surface
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<SubSurface> subSurface(Test::createSubSurface(surface.get(), parentSurface.get()));
|
std::unique_ptr<KWayland::Client::SubSurface> subSurface(Test::createSubSurface(surface.get(), parentSurface.get()));
|
||||||
QVERIFY(subSurface != nullptr);
|
QVERIFY(subSurface != nullptr);
|
||||||
|
|
||||||
// set buffer sizes
|
// set buffer sizes
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include <xcb/xcb_icccm.h>
|
#include <xcb/xcb_icccm.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_dbus_interface-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_dbus_interface-0");
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,6 @@ void DebugConsoleTest::testWaylandClient()
|
||||||
QVERIFY(Test::setupWaylandConnection());
|
QVERIFY(Test::setupWaylandConnection());
|
||||||
|
|
||||||
// create the Surface and ShellSurface
|
// create the Surface and ShellSurface
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface->isValid());
|
QVERIFY(surface->isValid());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -361,7 +360,7 @@ void DebugConsoleTest::testWaylandClient()
|
||||||
// now close the window again, it should be removed from the model
|
// now close the window again, it should be removed from the model
|
||||||
QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved);
|
QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved);
|
||||||
|
|
||||||
surface->attachBuffer(Buffer::Ptr());
|
surface->attachBuffer(KWayland::Client::Buffer::Ptr());
|
||||||
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
QVERIFY(rowsRemovedSpy.wait());
|
QVERIFY(rowsRemovedSpy.wait());
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,6 @@ private:
|
||||||
|
|
||||||
std::pair<Window *, std::unique_ptr<KWayland::Client::Surface>> DecorationInputTest::showWindow()
|
std::pair<Window *, std::unique_ptr<KWayland::Client::Surface>> DecorationInputTest::showWindow()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
#define VERIFY(statement) \
|
#define VERIFY(statement) \
|
||||||
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
|
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
|
||||||
return {nullptr, nullptr};
|
return {nullptr, nullptr};
|
||||||
|
@ -146,7 +145,6 @@ void DecorationInputTest::initTestCase()
|
||||||
|
|
||||||
void DecorationInputTest::init()
|
void DecorationInputTest::init()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1));
|
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1));
|
||||||
QVERIFY(Test::waitForWaylandPointer());
|
QVERIFY(Test::waitForWaylandPointer());
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,6 @@ void DontCrashCancelAnimationFromAnimationEndedTest::testScript()
|
||||||
}
|
}
|
||||||
QVERIFY(static_cast<EffectsHandlerImpl *>(effects)->isEffectLoaded(QStringLiteral("crashy")));
|
QVERIFY(static_cast<EffectsHandlerImpl *>(effects)->isEffectLoaded(QStringLiteral("crashy")));
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create a window
|
// create a window
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface{Test::createSurface()};
|
std::unique_ptr<KWayland::Client::Surface> surface{Test::createSurface()};
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
|
|
|
@ -109,8 +109,6 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor()
|
||||||
QVERIFY(effectsImpl);
|
QVERIFY(effectsImpl);
|
||||||
|
|
||||||
// Create the test window.
|
// Create the test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_dont_crash_useractions_menu-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_dont_crash_useractions_menu-0");
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,6 @@ void DesktopSwitchingAnimationTest::testSwitchDesktops()
|
||||||
|
|
||||||
// The Fade Desktop effect will do nothing if there are no windows to fade,
|
// The Fade Desktop effect will do nothing if there are no windows to fade,
|
||||||
// so we have to create a dummy test window.
|
// so we have to create a dummy test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
|
|
@ -82,8 +82,6 @@ void MaximizeAnimationTest::testMaximizeRestore()
|
||||||
// This test verifies that the maximize effect animates a window
|
// This test verifies that the maximize effect animates a window
|
||||||
// when it's maximized or restored.
|
// when it's maximized or restored.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Create the test window.
|
// Create the test window.
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
|
@ -96,9 +96,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
|
||||||
// This test verifies that a minimize effect tries to animate a window
|
// This test verifies that a minimize effect tries to animate a window
|
||||||
// when it's minimized or unminimized.
|
// when it's minimized or unminimized.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
QSignalSpy plasmaWindowCreatedSpy(Test::waylandWindowManagement(), &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
||||||
|
|
||||||
QSignalSpy plasmaWindowCreatedSpy(Test::waylandWindowManagement(), &PlasmaWindowManagement::windowCreated);
|
|
||||||
|
|
||||||
// Create a panel at the top of the screen.
|
// Create a panel at the top of the screen.
|
||||||
const QRect panelRect = QRect(0, 0, 1280, 36);
|
const QRect panelRect = QRect(0, 0, 1280, 36);
|
||||||
|
@ -106,11 +104,11 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
|
||||||
QVERIFY(panelSurface != nullptr);
|
QVERIFY(panelSurface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> panelShellSurface(Test::createXdgToplevelSurface(panelSurface.get()));
|
std::unique_ptr<Test::XdgToplevel> panelShellSurface(Test::createXdgToplevelSurface(panelSurface.get()));
|
||||||
QVERIFY(panelShellSurface != nullptr);
|
QVERIFY(panelShellSurface != nullptr);
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaPanelShellSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaPanelShellSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get()));
|
||||||
QVERIFY(plasmaPanelShellSurface != nullptr);
|
QVERIFY(plasmaPanelShellSurface != nullptr);
|
||||||
plasmaPanelShellSurface->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaPanelShellSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
plasmaPanelShellSurface->setPosition(panelRect.topLeft());
|
plasmaPanelShellSurface->setPosition(panelRect.topLeft());
|
||||||
plasmaPanelShellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible);
|
plasmaPanelShellSurface->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::AlwaysVisible);
|
||||||
Window *panel = Test::renderAndWaitForShown(panelSurface.get(), panelRect.size(), Qt::blue);
|
Window *panel = Test::renderAndWaitForShown(panelSurface.get(), panelRect.size(), Qt::blue);
|
||||||
QVERIFY(panel);
|
QVERIFY(panel);
|
||||||
QVERIFY(panel->isDock());
|
QVERIFY(panel->isDock());
|
||||||
|
@ -130,7 +128,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
|
||||||
|
|
||||||
// We have to set the minimized geometry because the squash effect needs it,
|
// We have to set the minimized geometry because the squash effect needs it,
|
||||||
// otherwise it won't start animation.
|
// otherwise it won't start animation.
|
||||||
auto plasmaWindow = plasmaWindowCreatedSpy.last().first().value<PlasmaWindow *>();
|
auto plasmaWindow = plasmaWindowCreatedSpy.last().first().value<KWayland::Client::PlasmaWindow *>();
|
||||||
QVERIFY(plasmaWindow);
|
QVERIFY(plasmaWindow);
|
||||||
const QRect iconRect = QRect(0, 0, 42, 36);
|
const QRect iconRect = QRect(0, 0, 42, 36);
|
||||||
plasmaWindow->setMinimizedGeometry(panelSurface.get(), iconRect);
|
plasmaWindow->setMinimizedGeometry(panelSurface.get(), iconRect);
|
||||||
|
|
|
@ -95,7 +95,6 @@ void PopupOpenCloseAnimationTest::testAnimatePopups()
|
||||||
QVERIFY(effectsImpl);
|
QVERIFY(effectsImpl);
|
||||||
|
|
||||||
// Create the main window.
|
// Create the main window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> mainWindowSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> mainWindowSurface(Test::createSurface());
|
||||||
QVERIFY(mainWindowSurface != nullptr);
|
QVERIFY(mainWindowSurface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.get()));
|
std::unique_ptr<Test::XdgToplevel> mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.get()));
|
||||||
|
@ -156,7 +155,6 @@ void PopupOpenCloseAnimationTest::testAnimateUserActionsPopup()
|
||||||
QVERIFY(effectsImpl);
|
QVERIFY(effectsImpl);
|
||||||
|
|
||||||
// Create the test window.
|
// Create the test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -208,7 +206,6 @@ void PopupOpenCloseAnimationTest::testAnimateDecorationTooltips()
|
||||||
QVERIFY(effectsImpl);
|
QVERIFY(effectsImpl);
|
||||||
|
|
||||||
// Create the test window.
|
// Create the test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
||||||
|
|
|
@ -187,7 +187,6 @@ void ScriptedEffectsTest::testEffectsHandler()
|
||||||
// trigger windowAdded signal
|
// trigger windowAdded signal
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -266,7 +265,6 @@ void ScriptedEffectsTest::testAnimations()
|
||||||
QVERIFY(effect->load(file));
|
QVERIFY(effect->load(file));
|
||||||
|
|
||||||
// animated after window added connect
|
// animated after window added connect
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -373,7 +371,6 @@ void ScriptedEffectsTest::testFullScreenEffect()
|
||||||
QVERIFY(effectOther->load("screenEdgeTouchTest"));
|
QVERIFY(effectOther->load("screenEdgeTouchTest"));
|
||||||
QSignalSpy isActiveFullScreenEffectSpyOther(effectOther, &ScriptedEffect::isActiveFullScreenEffectChanged);
|
QSignalSpy isActiveFullScreenEffectSpyOther(effectOther, &ScriptedEffect::isActiveFullScreenEffectChanged);
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -436,7 +433,6 @@ void ScriptedEffectsTest::testKeepAlive()
|
||||||
QVERIFY(effect->load(file));
|
QVERIFY(effect->load(file));
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -480,7 +476,6 @@ void ScriptedEffectsTest::testGrab()
|
||||||
QVERIFY(effect->load(QStringLiteral("grabTest")));
|
QVERIFY(effect->load(QStringLiteral("grabTest")));
|
||||||
|
|
||||||
// create test window
|
// create test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -511,7 +506,6 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindow()
|
||||||
QVERIFY(grabber->load(QStringLiteral("grabAlreadyGrabbedWindowTest_grabber")));
|
QVERIFY(grabber->load(QStringLiteral("grabAlreadyGrabbedWindowTest_grabber")));
|
||||||
|
|
||||||
// create test window
|
// create test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -546,7 +540,6 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindowForced()
|
||||||
QVERIFY(thief->load(QStringLiteral("grabAlreadyGrabbedWindowForcedTest_thief")));
|
QVERIFY(thief->load(QStringLiteral("grabAlreadyGrabbedWindowForcedTest_thief")));
|
||||||
|
|
||||||
// create test window
|
// create test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -576,7 +569,6 @@ void ScriptedEffectsTest::testUngrab()
|
||||||
QVERIFY(effect->load(QStringLiteral("ungrabTest")));
|
QVERIFY(effect->load(QStringLiteral("ungrabTest")));
|
||||||
|
|
||||||
// create test window
|
// create test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -619,7 +611,6 @@ void ScriptedEffectsTest::testRedirect()
|
||||||
QVERIFY(effect->load(file));
|
QVERIFY(effect->load(file));
|
||||||
|
|
||||||
// create test window
|
// create test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
@ -696,7 +687,6 @@ void ScriptedEffectsTest::testComplete()
|
||||||
QVERIFY(effect->load(QStringLiteral("completeTest")));
|
QVERIFY(effect->load(QStringLiteral("completeTest")));
|
||||||
|
|
||||||
// create test window
|
// create test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
|
||||||
|
|
|
@ -291,24 +291,23 @@ void SlidingPopupsTest::testWithOtherEffectWayland()
|
||||||
QVERIFY(!otherEffect->isActive());
|
QVERIFY(!otherEffect->isActive());
|
||||||
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
|
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
// the test created the slide protocol, let's create a Registry and listen for it
|
// the test created the slide protocol, let's create a Registry and listen for it
|
||||||
std::unique_ptr<Registry> registry(new Registry);
|
std::unique_ptr<KWayland::Client::Registry> registry(new KWayland::Client::Registry);
|
||||||
registry->create(Test::waylandConnection());
|
registry->create(Test::waylandConnection());
|
||||||
|
|
||||||
QSignalSpy interfacesAnnouncedSpy(registry.get(), &Registry::interfacesAnnounced);
|
QSignalSpy interfacesAnnouncedSpy(registry.get(), &KWayland::Client::Registry::interfacesAnnounced);
|
||||||
registry->setup();
|
registry->setup();
|
||||||
QVERIFY(interfacesAnnouncedSpy.wait());
|
QVERIFY(interfacesAnnouncedSpy.wait());
|
||||||
auto slideInterface = registry->interface(Registry::Interface::Slide);
|
auto slideInterface = registry->interface(KWayland::Client::Registry::Interface::Slide);
|
||||||
QVERIFY(slideInterface.name != 0);
|
QVERIFY(slideInterface.name != 0);
|
||||||
std::unique_ptr<SlideManager> slideManager(registry->createSlideManager(slideInterface.name, slideInterface.version));
|
std::unique_ptr<KWayland::Client::SlideManager> slideManager(registry->createSlideManager(slideInterface.name, slideInterface.version));
|
||||||
QVERIFY(slideManager);
|
QVERIFY(slideManager);
|
||||||
|
|
||||||
// create Wayland window
|
// create Wayland window
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface);
|
QVERIFY(surface);
|
||||||
std::unique_ptr<Slide> slide(slideManager->createSlide(surface.get()));
|
std::unique_ptr<KWayland::Client::Slide> slide(slideManager->createSlide(surface.get()));
|
||||||
slide->setLocation(Slide::Location::Left);
|
slide->setLocation(KWayland::Client::Slide::Location::Left);
|
||||||
slide->commit();
|
slide->commit();
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
QVERIFY(shellSurface);
|
QVERIFY(shellSurface);
|
||||||
|
|
|
@ -112,7 +112,6 @@ void ToplevelOpenCloseAnimationTest::testAnimateToplevels()
|
||||||
QVERIFY(!effect->isActive());
|
QVERIFY(!effect->isActive());
|
||||||
|
|
||||||
// Create the test window.
|
// Create the test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -155,7 +154,6 @@ void ToplevelOpenCloseAnimationTest::testDontAnimatePopups()
|
||||||
QVERIFY(effectsImpl);
|
QVERIFY(effectsImpl);
|
||||||
|
|
||||||
// Create the main window.
|
// Create the main window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> mainWindowSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> mainWindowSurface(Test::createSurface());
|
||||||
QVERIFY(mainWindowSurface != nullptr);
|
QVERIFY(mainWindowSurface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.get()));
|
std::unique_ptr<Test::XdgToplevel> mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.get()));
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include <xcb/xcb_icccm.h>
|
#include <xcb/xcb_icccm.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_globalshortcuts-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_globalshortcuts-0");
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include <KWayland/Client/surface.h>
|
#include <KWayland/Client/surface.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_idle_inhbition_test-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_idle_inhbition_test-0");
|
||||||
|
|
||||||
|
@ -218,7 +217,7 @@ void TestIdleInhibition::testDontInhibitWhenUnmapped()
|
||||||
QCOMPARE(input()->idleInhibitors(), QList<Window *>{window});
|
QCOMPARE(input()->idleInhibitors(), QList<Window *>{window});
|
||||||
|
|
||||||
// Unmap the window.
|
// Unmap the window.
|
||||||
surface->attachBuffer(Buffer::Ptr());
|
surface->attachBuffer(KWayland::Client::Buffer::Ptr());
|
||||||
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
QVERIFY(Test::waitForWindowDestroyed(window));
|
QVERIFY(Test::waitForWindowDestroyed(window));
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,6 @@ void InputStackingOrderTest::initTestCase()
|
||||||
|
|
||||||
void InputStackingOrderTest::init()
|
void InputStackingOrderTest::init()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat));
|
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat));
|
||||||
QVERIFY(Test::waitForWaylandPointer());
|
QVERIFY(Test::waitForWaylandPointer());
|
||||||
|
|
||||||
|
@ -90,13 +89,13 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
|
||||||
// the pointer is in the overlapping area which means the top most window has focus
|
// the pointer is in the overlapping area which means the top most window has focus
|
||||||
// as soon as the top most window gets lowered the window should lose focus and the
|
// as soon as the top most window gets lowered the window should lose focus and the
|
||||||
// other window should gain focus without a mouse event in between
|
// other window should gain focus without a mouse event in between
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for enter and leave signals
|
// create pointer and signal spy for enter and leave signals
|
||||||
auto pointer = Test::waylandSeat()->createPointer(Test::waylandSeat());
|
auto pointer = Test::waylandSeat()->createPointer(Test::waylandSeat());
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
|
|
||||||
// now create the two windows and make them overlap
|
// now create the two windows and make them overlap
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include <linux/input-event-codes.h>
|
#include <linux/input-event-codes.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
using KWin::VirtualKeyboardDBus;
|
using KWin::VirtualKeyboardDBus;
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_inputmethod-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_inputmethod-0");
|
||||||
|
@ -131,7 +130,7 @@ void InputMethodTest::testOpenClose()
|
||||||
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
||||||
QVERIFY(surfaceConfigureRequestedSpy.wait());
|
QVERIFY(surfaceConfigureRequestedSpy.wait());
|
||||||
|
|
||||||
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
std::unique_ptr<KWayland::Client::TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
||||||
QVERIFY(textInput != nullptr);
|
QVERIFY(textInput != nullptr);
|
||||||
|
|
||||||
// Show the keyboard
|
// Show the keyboard
|
||||||
|
@ -242,7 +241,7 @@ void InputMethodTest::testEnableActive()
|
||||||
|
|
||||||
// Show the keyboard
|
// Show the keyboard
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
std::unique_ptr<KWayland::Client::TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
||||||
textInput->enable(surface.get());
|
textInput->enable(surface.get());
|
||||||
QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged);
|
QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged);
|
||||||
QVERIFY(paneladded.wait());
|
QVERIFY(paneladded.wait());
|
||||||
|
@ -272,7 +271,7 @@ void InputMethodTest::testHidePanel()
|
||||||
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
|
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
|
||||||
|
|
||||||
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
|
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
|
||||||
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
std::unique_ptr<KWayland::Client::TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
||||||
|
|
||||||
// Create an xdg_toplevel surface and wait for the compositor to catch up.
|
// Create an xdg_toplevel surface and wait for the compositor to catch up.
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
|
@ -315,7 +314,7 @@ void InputMethodTest::testSwitchFocusedSurfaces()
|
||||||
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
|
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
|
||||||
|
|
||||||
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
|
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
|
||||||
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
std::unique_ptr<KWayland::Client::TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
||||||
|
|
||||||
QVector<Window *> windows;
|
QVector<Window *> windows;
|
||||||
std::vector<std::unique_ptr<KWayland::Client::Surface>> surfaces;
|
std::vector<std::unique_ptr<KWayland::Client::Surface>> surfaces;
|
||||||
|
@ -363,7 +362,7 @@ void InputMethodTest::testV2V3SameClient()
|
||||||
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
|
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
|
||||||
|
|
||||||
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
|
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
|
||||||
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
std::unique_ptr<KWayland::Client::TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
||||||
|
|
||||||
auto textInputV3 = std::make_unique<Test::TextInputV3>();
|
auto textInputV3 = std::make_unique<Test::TextInputV3>();
|
||||||
textInputV3->init(Test::waylandTextInputManagerV3()->get_text_input(*(Test::waylandSeat())));
|
textInputV3->init(Test::waylandTextInputManagerV3()->get_text_input(*(Test::waylandSeat())));
|
||||||
|
@ -572,21 +571,21 @@ void InputMethodTest::testModifierForwarding()
|
||||||
auto context = Test::inputMethod()->context();
|
auto context = Test::inputMethod()->context();
|
||||||
std::unique_ptr<KWayland::Client::Keyboard> keyboardGrab(new KWayland::Client::Keyboard);
|
std::unique_ptr<KWayland::Client::Keyboard> keyboardGrab(new KWayland::Client::Keyboard);
|
||||||
keyboardGrab->setup(zwp_input_method_context_v1_grab_keyboard(context));
|
keyboardGrab->setup(zwp_input_method_context_v1_grab_keyboard(context));
|
||||||
QSignalSpy modifierSpy(keyboardGrab.get(), &Keyboard::modifiersChanged);
|
QSignalSpy modifierSpy(keyboardGrab.get(), &KWayland::Client::Keyboard::modifiersChanged);
|
||||||
// Wait for initial modifiers update
|
// Wait for initial modifiers update
|
||||||
QVERIFY(modifierSpy.wait());
|
QVERIFY(modifierSpy.wait());
|
||||||
|
|
||||||
quint32 timestamp = 1;
|
quint32 timestamp = 1;
|
||||||
|
|
||||||
QSignalSpy keySpy(keyboardGrab.get(), &Keyboard::keyChanged);
|
QSignalSpy keySpy(keyboardGrab.get(), &KWayland::Client::Keyboard::keyChanged);
|
||||||
bool keyChanged = false;
|
bool keyChanged = false;
|
||||||
bool modifiersChanged = false;
|
bool modifiersChanged = false;
|
||||||
// We want to verify the order of two signals, so SignalSpy is not very useful here.
|
// We want to verify the order of two signals, so SignalSpy is not very useful here.
|
||||||
auto keyChangedConnection = connect(keyboardGrab.get(), &Keyboard::keyChanged, [&keyChanged, &modifiersChanged]() {
|
auto keyChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::keyChanged, [&keyChanged, &modifiersChanged]() {
|
||||||
QVERIFY(!modifiersChanged);
|
QVERIFY(!modifiersChanged);
|
||||||
keyChanged = true;
|
keyChanged = true;
|
||||||
});
|
});
|
||||||
auto modifiersChangedConnection = connect(keyboardGrab.get(), &Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() {
|
auto modifiersChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() {
|
||||||
QVERIFY(keyChanged);
|
QVERIFY(keyChanged);
|
||||||
modifiersChanged = true;
|
modifiersChanged = true;
|
||||||
});
|
});
|
||||||
|
@ -603,11 +602,11 @@ void InputMethodTest::testModifierForwarding()
|
||||||
// verify the order of key and modifiers again. Key first, then modifiers.
|
// verify the order of key and modifiers again. Key first, then modifiers.
|
||||||
keyChanged = false;
|
keyChanged = false;
|
||||||
modifiersChanged = false;
|
modifiersChanged = false;
|
||||||
keyChangedConnection = connect(keyboardGrab.get(), &Keyboard::keyChanged, [&keyChanged, &modifiersChanged]() {
|
keyChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::keyChanged, [&keyChanged, &modifiersChanged]() {
|
||||||
QVERIFY(!modifiersChanged);
|
QVERIFY(!modifiersChanged);
|
||||||
keyChanged = true;
|
keyChanged = true;
|
||||||
});
|
});
|
||||||
modifiersChangedConnection = connect(keyboardGrab.get(), &Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() {
|
modifiersChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() {
|
||||||
QVERIFY(keyChanged);
|
QVERIFY(keyChanged);
|
||||||
modifiersChanged = true;
|
modifiersChanged = true;
|
||||||
});
|
});
|
||||||
|
@ -650,15 +649,15 @@ void InputMethodTest::testFakeEventFallback()
|
||||||
keySpy.wait();
|
keySpy.wait();
|
||||||
QVERIFY(keySpy.count() == 2);
|
QVERIFY(keySpy.count() == 2);
|
||||||
|
|
||||||
auto compare = [](const QList<QVariant> &input, quint32 key, Keyboard::KeyState state) {
|
auto compare = [](const QList<QVariant> &input, quint32 key, KWayland::Client::Keyboard::KeyState state) {
|
||||||
auto inputKey = input.at(0).toInt();
|
auto inputKey = input.at(0).toInt();
|
||||||
auto inputState = input.at(1).value<Keyboard::KeyState>();
|
auto inputState = input.at(1).value<KWayland::Client::Keyboard::KeyState>();
|
||||||
QCOMPARE(inputKey, key);
|
QCOMPARE(inputKey, key);
|
||||||
QCOMPARE(inputState, state);
|
QCOMPARE(inputState, state);
|
||||||
};
|
};
|
||||||
|
|
||||||
compare(keySpy.at(0), KEY_A, Keyboard::KeyState::Pressed);
|
compare(keySpy.at(0), KEY_A, KWayland::Client::Keyboard::KeyState::Pressed);
|
||||||
compare(keySpy.at(1), KEY_A, Keyboard::KeyState::Released);
|
compare(keySpy.at(1), KEY_A, KWayland::Client::Keyboard::KeyState::Released);
|
||||||
|
|
||||||
keySpy.clear();
|
keySpy.clear();
|
||||||
|
|
||||||
|
@ -670,10 +669,10 @@ void InputMethodTest::testFakeEventFallback()
|
||||||
keySpy.wait();
|
keySpy.wait();
|
||||||
QVERIFY(keySpy.count() == 4);
|
QVERIFY(keySpy.count() == 4);
|
||||||
|
|
||||||
compare(keySpy.at(0), KEY_LEFTSHIFT, Keyboard::KeyState::Pressed);
|
compare(keySpy.at(0), KEY_LEFTSHIFT, KWayland::Client::Keyboard::KeyState::Pressed);
|
||||||
compare(keySpy.at(1), KEY_A, Keyboard::KeyState::Pressed);
|
compare(keySpy.at(1), KEY_A, KWayland::Client::Keyboard::KeyState::Pressed);
|
||||||
compare(keySpy.at(2), KEY_A, Keyboard::KeyState::Released);
|
compare(keySpy.at(2), KEY_A, KWayland::Client::Keyboard::KeyState::Released);
|
||||||
compare(keySpy.at(3), KEY_LEFTSHIFT, Keyboard::KeyState::Released);
|
compare(keySpy.at(3), KEY_LEFTSHIFT, KWayland::Client::Keyboard::KeyState::Released);
|
||||||
|
|
||||||
keySpy.clear();
|
keySpy.clear();
|
||||||
|
|
||||||
|
@ -685,8 +684,8 @@ void InputMethodTest::testFakeEventFallback()
|
||||||
keySpy.wait();
|
keySpy.wait();
|
||||||
QVERIFY(keySpy.count() == 2);
|
QVERIFY(keySpy.count() == 2);
|
||||||
|
|
||||||
compare(keySpy.at(0), KEY_ENTER, Keyboard::KeyState::Pressed);
|
compare(keySpy.at(0), KEY_ENTER, KWayland::Client::Keyboard::KeyState::Pressed);
|
||||||
compare(keySpy.at(1), KEY_ENTER, Keyboard::KeyState::Released);
|
compare(keySpy.at(1), KEY_ENTER, KWayland::Client::Keyboard::KeyState::Released);
|
||||||
}
|
}
|
||||||
|
|
||||||
WAYLANDTEST_MAIN(InputMethodTest)
|
WAYLANDTEST_MAIN(InputMethodTest)
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(NET::WindowType);
|
Q_DECLARE_METATYPE(NET::WindowType);
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
|
@ -352,11 +350,11 @@ void InternalWindowTest::testKeyboardTriggersLeave()
|
||||||
{
|
{
|
||||||
// this test verifies that a leave event is sent to a window when an internal window
|
// this test verifies that a leave event is sent to a window when an internal window
|
||||||
// gets a key event
|
// gets a key event
|
||||||
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
||||||
QVERIFY(keyboard != nullptr);
|
QVERIFY(keyboard != nullptr);
|
||||||
QVERIFY(keyboard->isValid());
|
QVERIFY(keyboard->isValid());
|
||||||
QSignalSpy enteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy enteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy leftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy leftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_keyboard_laout-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_keyboard_laout-0");
|
||||||
|
|
||||||
|
@ -414,7 +413,6 @@ void KeyboardLayoutTest::testWindowPolicy()
|
||||||
QCOMPARE(xkb->layoutName(), QStringLiteral("English (US)"));
|
QCOMPARE(xkb->layoutName(), QStringLiteral("English (US)"));
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
auto c1 = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
auto c1 = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
||||||
|
@ -461,7 +459,6 @@ void KeyboardLayoutTest::testApplicationPolicy()
|
||||||
QCOMPARE(xkb->layoutName(), QStringLiteral("English (US)"));
|
QCOMPARE(xkb->layoutName(), QStringLiteral("English (US)"));
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
shellSurface->set_app_id(QStringLiteral("org.kde.foo"));
|
shellSurface->set_app_id(QStringLiteral("org.kde.foo"));
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_keymap_creation_failure-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_keymap_creation_failure-0");
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <QDBusPendingReply>
|
#include <QDBusPendingReply>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_kwinbindings-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_kwinbindings-0");
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,6 @@ void LockScreenTest::unlock()
|
||||||
|
|
||||||
std::pair<Window *, std::unique_ptr<KWayland::Client::Surface>> LockScreenTest::showWindow()
|
std::pair<Window *, std::unique_ptr<KWayland::Client::Surface>> LockScreenTest::showWindow()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
#define VERIFY(statement) \
|
#define VERIFY(statement) \
|
||||||
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
|
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
|
||||||
return {nullptr, nullptr};
|
return {nullptr, nullptr};
|
||||||
|
@ -232,12 +231,10 @@ void LockScreenTest::testStackingOrder()
|
||||||
|
|
||||||
void LockScreenTest::testPointer()
|
void LockScreenTest::testPointer()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
std::unique_ptr<KWayland::Client::Pointer> pointer(m_seat->createPointer());
|
||||||
|
|
||||||
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
|
|
||||||
QVERIFY(pointer != nullptr);
|
QVERIFY(pointer != nullptr);
|
||||||
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy enteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy leftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
|
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -277,12 +274,10 @@ void LockScreenTest::testPointer()
|
||||||
|
|
||||||
void LockScreenTest::testPointerButton()
|
void LockScreenTest::testPointerButton()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
std::unique_ptr<KWayland::Client::Pointer> pointer(m_seat->createPointer());
|
||||||
|
|
||||||
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
|
|
||||||
QVERIFY(pointer != nullptr);
|
QVERIFY(pointer != nullptr);
|
||||||
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy enteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy buttonChangedSpy(pointer.get(), &Pointer::buttonStateChanged);
|
QSignalSpy buttonChangedSpy(pointer.get(), &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
|
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -318,12 +313,10 @@ void LockScreenTest::testPointerButton()
|
||||||
|
|
||||||
void LockScreenTest::testPointerAxis()
|
void LockScreenTest::testPointerAxis()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
std::unique_ptr<KWayland::Client::Pointer> pointer(m_seat->createPointer());
|
||||||
|
|
||||||
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
|
|
||||||
QVERIFY(pointer != nullptr);
|
QVERIFY(pointer != nullptr);
|
||||||
QSignalSpy axisChangedSpy(pointer.get(), &Pointer::axisChanged);
|
QSignalSpy axisChangedSpy(pointer.get(), &KWayland::Client::Pointer::axisChanged);
|
||||||
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy enteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
|
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -358,13 +351,11 @@ void LockScreenTest::testPointerAxis()
|
||||||
|
|
||||||
void LockScreenTest::testKeyboard()
|
void LockScreenTest::testKeyboard()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(m_seat->createKeyboard());
|
||||||
|
|
||||||
std::unique_ptr<Keyboard> keyboard(m_seat->createKeyboard());
|
|
||||||
QVERIFY(keyboard != nullptr);
|
QVERIFY(keyboard != nullptr);
|
||||||
QSignalSpy enteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy enteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy leftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy leftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
QSignalSpy keyChangedSpy(keyboard.get(), &Keyboard::keyChanged);
|
QSignalSpy keyChangedSpy(keyboard.get(), &KWayland::Client::Keyboard::keyChanged);
|
||||||
|
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -376,13 +367,13 @@ void LockScreenTest::testKeyboard()
|
||||||
QVERIFY(keyChangedSpy.wait());
|
QVERIFY(keyChangedSpy.wait());
|
||||||
QCOMPARE(keyChangedSpy.count(), 1);
|
QCOMPARE(keyChangedSpy.count(), 1);
|
||||||
QCOMPARE(keyChangedSpy.at(0).at(0).value<quint32>(), quint32(KEY_A));
|
QCOMPARE(keyChangedSpy.at(0).at(0).value<quint32>(), quint32(KEY_A));
|
||||||
QCOMPARE(keyChangedSpy.at(0).at(1).value<Keyboard::KeyState>(), Keyboard::KeyState::Pressed);
|
QCOMPARE(keyChangedSpy.at(0).at(1).value<KWayland::Client::Keyboard::KeyState>(), KWayland::Client::Keyboard::KeyState::Pressed);
|
||||||
QCOMPARE(keyChangedSpy.at(0).at(2).value<quint32>(), quint32(1));
|
QCOMPARE(keyChangedSpy.at(0).at(2).value<quint32>(), quint32(1));
|
||||||
KEYRELEASE(KEY_A);
|
KEYRELEASE(KEY_A);
|
||||||
QVERIFY(keyChangedSpy.wait());
|
QVERIFY(keyChangedSpy.wait());
|
||||||
QCOMPARE(keyChangedSpy.count(), 2);
|
QCOMPARE(keyChangedSpy.count(), 2);
|
||||||
QCOMPARE(keyChangedSpy.at(1).at(0).value<quint32>(), quint32(KEY_A));
|
QCOMPARE(keyChangedSpy.at(1).at(0).value<quint32>(), quint32(KEY_A));
|
||||||
QCOMPARE(keyChangedSpy.at(1).at(1).value<Keyboard::KeyState>(), Keyboard::KeyState::Released);
|
QCOMPARE(keyChangedSpy.at(1).at(1).value<KWayland::Client::Keyboard::KeyState>(), KWayland::Client::Keyboard::KeyState::Released);
|
||||||
QCOMPARE(keyChangedSpy.at(1).at(2).value<quint32>(), quint32(2));
|
QCOMPARE(keyChangedSpy.at(1).at(2).value<quint32>(), quint32(2));
|
||||||
|
|
||||||
LOCK;
|
LOCK;
|
||||||
|
@ -406,8 +397,8 @@ void LockScreenTest::testKeyboard()
|
||||||
QCOMPARE(keyChangedSpy.at(3).at(0).value<quint32>(), quint32(KEY_C));
|
QCOMPARE(keyChangedSpy.at(3).at(0).value<quint32>(), quint32(KEY_C));
|
||||||
QCOMPARE(keyChangedSpy.at(2).at(2).value<quint32>(), quint32(5));
|
QCOMPARE(keyChangedSpy.at(2).at(2).value<quint32>(), quint32(5));
|
||||||
QCOMPARE(keyChangedSpy.at(3).at(2).value<quint32>(), quint32(6));
|
QCOMPARE(keyChangedSpy.at(3).at(2).value<quint32>(), quint32(6));
|
||||||
QCOMPARE(keyChangedSpy.at(2).at(1).value<Keyboard::KeyState>(), Keyboard::KeyState::Pressed);
|
QCOMPARE(keyChangedSpy.at(2).at(1).value<KWayland::Client::Keyboard::KeyState>(), KWayland::Client::Keyboard::KeyState::Pressed);
|
||||||
QCOMPARE(keyChangedSpy.at(3).at(1).value<Keyboard::KeyState>(), Keyboard::KeyState::Released);
|
QCOMPARE(keyChangedSpy.at(3).at(1).value<KWayland::Client::Keyboard::KeyState>(), KWayland::Client::Keyboard::KeyState::Released);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LockScreenTest::testScreenEdge()
|
void LockScreenTest::testScreenEdge()
|
||||||
|
@ -549,7 +540,6 @@ void LockScreenTest::testEffectsKeyboardAutorepeat()
|
||||||
|
|
||||||
void LockScreenTest::testMoveWindow()
|
void LockScreenTest::testMoveWindow()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized);
|
QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized);
|
||||||
|
@ -589,7 +579,6 @@ void LockScreenTest::testMoveWindow()
|
||||||
|
|
||||||
void LockScreenTest::testPointerShortcut()
|
void LockScreenTest::testPointerShortcut()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<QAction> action(new QAction(nullptr));
|
std::unique_ptr<QAction> action(new QAction(nullptr));
|
||||||
QSignalSpy actionSpy(action.get(), &QAction::triggered);
|
QSignalSpy actionSpy(action.get(), &QAction::triggered);
|
||||||
input()->registerPointerShortcut(Qt::MetaModifier, Qt::LeftButton, action.get());
|
input()->registerPointerShortcut(Qt::MetaModifier, Qt::LeftButton, action.get());
|
||||||
|
@ -633,7 +622,6 @@ void LockScreenTest::testAxisShortcut_data()
|
||||||
|
|
||||||
void LockScreenTest::testAxisShortcut()
|
void LockScreenTest::testAxisShortcut()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<QAction> action(new QAction(nullptr));
|
std::unique_ptr<QAction> action(new QAction(nullptr));
|
||||||
QSignalSpy actionSpy(action.get(), &QAction::triggered);
|
QSignalSpy actionSpy(action.get(), &QAction::triggered);
|
||||||
QFETCH(Qt::Orientation, direction);
|
QFETCH(Qt::Orientation, direction);
|
||||||
|
@ -676,7 +664,6 @@ void LockScreenTest::testAxisShortcut()
|
||||||
|
|
||||||
void LockScreenTest::testKeyboardShortcut()
|
void LockScreenTest::testKeyboardShortcut()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<QAction> action(new QAction(nullptr));
|
std::unique_ptr<QAction> action(new QAction(nullptr));
|
||||||
QSignalSpy actionSpy(action.get(), &QAction::triggered);
|
QSignalSpy actionSpy(action.get(), &QAction::triggered);
|
||||||
action->setProperty("componentName", QStringLiteral("kwin"));
|
action->setProperty("componentName", QStringLiteral("kwin"));
|
||||||
|
@ -719,15 +706,14 @@ void LockScreenTest::testKeyboardShortcut()
|
||||||
|
|
||||||
void LockScreenTest::testTouch()
|
void LockScreenTest::testTouch()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto touch = m_seat->createTouch(m_seat);
|
auto touch = m_seat->createTouch(m_seat);
|
||||||
QVERIFY(touch);
|
QVERIFY(touch);
|
||||||
QVERIFY(touch->isValid());
|
QVERIFY(touch->isValid());
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
QSignalSpy sequenceStartedSpy(touch, &Touch::sequenceStarted);
|
QSignalSpy sequenceStartedSpy(touch, &KWayland::Client::Touch::sequenceStarted);
|
||||||
QSignalSpy cancelSpy(touch, &Touch::sequenceCanceled);
|
QSignalSpy cancelSpy(touch, &KWayland::Client::Touch::sequenceCanceled);
|
||||||
QSignalSpy pointRemovedSpy(touch, &Touch::pointRemoved);
|
QSignalSpy pointRemovedSpy(touch, &KWayland::Client::Touch::pointRemoved);
|
||||||
|
|
||||||
quint32 timestamp = 1;
|
quint32 timestamp = 1;
|
||||||
Test::touchDown(1, QPointF(25, 25), timestamp++);
|
Test::touchDown(1, QPointF(25, 25), timestamp++);
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include <KDecoration2/DecorationSettings>
|
#include <KDecoration2/DecorationSettings>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_maximized-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_maximized-0");
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_modifier_only_shortcut-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_modifier_only_shortcut-0");
|
||||||
static const QString s_serviceName = QStringLiteral("org.kde.KWin.Test.ModifierOnlyShortcut");
|
static const QString s_serviceName = QStringLiteral("org.kde.KWin.Test.ModifierOnlyShortcut");
|
||||||
|
|
|
@ -109,8 +109,6 @@ void MoveResizeWindowTest::cleanup()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testMove()
|
void MoveResizeWindowTest::testMove()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -182,7 +180,6 @@ void MoveResizeWindowTest::testMove()
|
||||||
void MoveResizeWindowTest::testResize()
|
void MoveResizeWindowTest::testResize()
|
||||||
{
|
{
|
||||||
// a test case which manually resizes a window
|
// a test case which manually resizes a window
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
@ -316,8 +313,6 @@ void MoveResizeWindowTest::testPackTo_data()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testPackTo()
|
void MoveResizeWindowTest::testPackTo()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -354,8 +349,6 @@ void MoveResizeWindowTest::testPackAgainstClient_data()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testPackAgainstClient()
|
void MoveResizeWindowTest::testPackAgainstClient()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface1(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface1(Test::createSurface());
|
||||||
QVERIFY(surface1 != nullptr);
|
QVERIFY(surface1 != nullptr);
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface2(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface2(Test::createSurface());
|
||||||
|
@ -421,8 +414,6 @@ void MoveResizeWindowTest::testGrowShrink_data()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testGrowShrink()
|
void MoveResizeWindowTest::testGrowShrink()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// block geometry helper
|
// block geometry helper
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface1(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface1(Test::createSurface());
|
||||||
QVERIFY(surface1 != nullptr);
|
QVERIFY(surface1 != nullptr);
|
||||||
|
@ -481,7 +472,6 @@ void MoveResizeWindowTest::testPointerMoveEnd_data()
|
||||||
void MoveResizeWindowTest::testPointerMoveEnd()
|
void MoveResizeWindowTest::testPointerMoveEnd()
|
||||||
{
|
{
|
||||||
// this test verifies that moving a window through pointer only ends if all buttons are released
|
// this test verifies that moving a window through pointer only ends if all buttons are released
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
@ -519,12 +509,11 @@ void MoveResizeWindowTest::testPointerMoveEnd()
|
||||||
}
|
}
|
||||||
void MoveResizeWindowTest::testClientSideMove()
|
void MoveResizeWindowTest::testClientSideMove()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
Cursors::self()->mouse()->setPos(640, 512);
|
Cursors::self()->mouse()->setPos(640, 512);
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy buttonSpy(pointer.get(), &Pointer::buttonStateChanged);
|
QSignalSpy buttonSpy(pointer.get(), &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -578,14 +567,13 @@ void MoveResizeWindowTest::testPlasmaShellSurfaceMovable_data()
|
||||||
void MoveResizeWindowTest::testPlasmaShellSurfaceMovable()
|
void MoveResizeWindowTest::testPlasmaShellSurfaceMovable()
|
||||||
{
|
{
|
||||||
// this test verifies that certain window types from PlasmaShellSurface are not moveable or resizable
|
// this test verifies that certain window types from PlasmaShellSurface are not moveable or resizable
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
QVERIFY(shellSurface != nullptr);
|
QVERIFY(shellSurface != nullptr);
|
||||||
// and a PlasmaShellSurface
|
// and a PlasmaShellSurface
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get()));
|
||||||
QVERIFY(plasmaSurface != nullptr);
|
QVERIFY(plasmaSurface != nullptr);
|
||||||
QFETCH(KWayland::Client::PlasmaShellSurface::Role, role);
|
QFETCH(KWayland::Client::PlasmaShellSurface::Role, role);
|
||||||
plasmaSurface->setRole(role);
|
plasmaSurface->setRole(role);
|
||||||
|
@ -723,7 +711,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel()
|
||||||
QVERIFY(panel->isDock());
|
QVERIFY(panel->isDock());
|
||||||
|
|
||||||
// let's create a window
|
// let's create a window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -784,15 +771,14 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel()
|
||||||
// see BUG 365892
|
// see BUG 365892
|
||||||
|
|
||||||
// first create our panel
|
// first create our panel
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> panelSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> panelSurface(Test::createSurface());
|
||||||
QVERIFY(panelSurface != nullptr);
|
QVERIFY(panelSurface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> panelShellSurface(Test::createXdgToplevelSurface(panelSurface.get()));
|
std::unique_ptr<Test::XdgToplevel> panelShellSurface(Test::createXdgToplevelSurface(panelSurface.get()));
|
||||||
QVERIFY(panelShellSurface != nullptr);
|
QVERIFY(panelShellSurface != nullptr);
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get()));
|
||||||
QVERIFY(plasmaSurface != nullptr);
|
QVERIFY(plasmaSurface != nullptr);
|
||||||
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
plasmaSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AutoHide);
|
plasmaSurface->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::AutoHide);
|
||||||
QFETCH(QRect, panelGeometry);
|
QFETCH(QRect, panelGeometry);
|
||||||
plasmaSurface->setPosition(panelGeometry.topLeft());
|
plasmaSurface->setPosition(panelGeometry.topLeft());
|
||||||
// let's render
|
// let's render
|
||||||
|
@ -855,8 +841,6 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard_data()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testResizeForVirtualKeyboard()
|
void MoveResizeWindowTest::testResizeForVirtualKeyboard()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -930,8 +914,6 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
|
void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -980,8 +962,6 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
|
||||||
|
|
||||||
void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
|
void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -1033,7 +1013,6 @@ void MoveResizeWindowTest::testDestroyMoveClient()
|
||||||
// the associated client is destroyed.
|
// the associated client is destroyed.
|
||||||
|
|
||||||
// Create the test client.
|
// Create the test client.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -1068,7 +1047,6 @@ void MoveResizeWindowTest::testDestroyResizeClient()
|
||||||
// the associated client is destroyed.
|
// the associated client is destroyed.
|
||||||
|
|
||||||
// Create the test client.
|
// Create the test client.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_no_global_shortcuts-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_no_global_shortcuts-0");
|
||||||
static const QString s_serviceName = QStringLiteral("org.kde.KWin.Test.ModifierOnlyShortcut");
|
static const QString s_serviceName = QStringLiteral("org.kde.KWin.Test.ModifierOnlyShortcut");
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
#include <netwm.h>
|
#include <netwm.h>
|
||||||
#include <xcb/xcb_icccm.h>
|
#include <xcb/xcb_icccm.h>
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -52,7 +50,7 @@ private Q_SLOTS:
|
||||||
void testDestroyedButNotUnmapped();
|
void testDestroyedButNotUnmapped();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlasmaWindowManagement *m_windowManagement = nullptr;
|
KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr;
|
||||||
KWayland::Client::Compositor *m_compositor = nullptr;
|
KWayland::Client::Compositor *m_compositor = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -92,7 +90,7 @@ void PlasmaWindowTest::cleanup()
|
||||||
void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
|
void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
|
||||||
{
|
{
|
||||||
// this test verifies that a PlasmaWindow gets unmapped on Client side when an X11 window is destroyed
|
// this test verifies that a PlasmaWindow gets unmapped on Client side when an X11 window is destroyed
|
||||||
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
||||||
|
|
||||||
// create an xcb window
|
// create an xcb window
|
||||||
struct XcbConnectionDeleter
|
struct XcbConnectionDeleter
|
||||||
|
@ -142,9 +140,9 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
|
||||||
QCOMPARE(m_windowManagement->windows().count(), 1);
|
QCOMPARE(m_windowManagement->windows().count(), 1);
|
||||||
auto pw = m_windowManagement->windows().first();
|
auto pw = m_windowManagement->windows().first();
|
||||||
QCOMPARE(pw->geometry(), window->frameGeometry());
|
QCOMPARE(pw->geometry(), window->frameGeometry());
|
||||||
QSignalSpy geometryChangedSpy(pw, &PlasmaWindow::geometryChanged);
|
QSignalSpy geometryChangedSpy(pw, &KWayland::Client::PlasmaWindow::geometryChanged);
|
||||||
|
|
||||||
QSignalSpy unmappedSpy(m_windowManagement->windows().first(), &PlasmaWindow::unmapped);
|
QSignalSpy unmappedSpy(m_windowManagement->windows().first(), &KWayland::Client::PlasmaWindow::unmapped);
|
||||||
QSignalSpy destroyedSpy(m_windowManagement->windows().first(), &QObject::destroyed);
|
QSignalSpy destroyedSpy(m_windowManagement->windows().first(), &QObject::destroyed);
|
||||||
|
|
||||||
// now shade the window
|
// now shade the window
|
||||||
|
@ -205,7 +203,7 @@ void HelperWindow::paintEvent(QPaintEvent *event)
|
||||||
void PlasmaWindowTest::testInternalWindowNoPlasmaWindow()
|
void PlasmaWindowTest::testInternalWindowNoPlasmaWindow()
|
||||||
{
|
{
|
||||||
// this test verifies that an internal window is not added as a PlasmaWindow
|
// this test verifies that an internal window is not added as a PlasmaWindow
|
||||||
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
||||||
HelperWindow win;
|
HelperWindow win;
|
||||||
win.setGeometry(0, 0, 100, 100);
|
win.setGeometry(0, 0, 100, 100);
|
||||||
win.show();
|
win.show();
|
||||||
|
@ -216,7 +214,7 @@ void PlasmaWindowTest::testInternalWindowNoPlasmaWindow()
|
||||||
void PlasmaWindowTest::testPopupWindowNoPlasmaWindow()
|
void PlasmaWindowTest::testPopupWindowNoPlasmaWindow()
|
||||||
{
|
{
|
||||||
// this test verifies that a popup window is not added as a PlasmaWindow
|
// this test verifies that a popup window is not added as a PlasmaWindow
|
||||||
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
||||||
|
|
||||||
// first create the parent window
|
// first create the parent window
|
||||||
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
||||||
|
@ -250,7 +248,7 @@ void PlasmaWindowTest::testLockScreenNoPlasmaWindow()
|
||||||
{
|
{
|
||||||
#if KWIN_BUILD_SCREENLOCKER
|
#if KWIN_BUILD_SCREENLOCKER
|
||||||
// this test verifies that lock screen windows are not exposed to PlasmaWindow
|
// this test verifies that lock screen windows are not exposed to PlasmaWindow
|
||||||
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
||||||
|
|
||||||
// this time we use a QSignalSpy on XdgShellClient as it'a a little bit more complex setup
|
// this time we use a QSignalSpy on XdgShellClient as it'a a little bit more complex setup
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
|
@ -283,7 +281,7 @@ void PlasmaWindowTest::testDestroyedButNotUnmapped()
|
||||||
{
|
{
|
||||||
// this test verifies that also when a ShellSurface gets destroyed without a prior unmap
|
// this test verifies that also when a ShellSurface gets destroyed without a prior unmap
|
||||||
// the PlasmaWindow gets destroyed on Client side
|
// the PlasmaWindow gets destroyed on Client side
|
||||||
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
|
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &KWayland::Client::PlasmaWindowManagement::windowCreated);
|
||||||
|
|
||||||
// first create the parent window
|
// first create the parent window
|
||||||
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
|
||||||
|
@ -293,7 +291,7 @@ void PlasmaWindowTest::testDestroyedButNotUnmapped()
|
||||||
// this should create a plasma window
|
// this should create a plasma window
|
||||||
QVERIFY(plasmaWindowCreatedSpy.wait());
|
QVERIFY(plasmaWindowCreatedSpy.wait());
|
||||||
QCOMPARE(plasmaWindowCreatedSpy.count(), 1);
|
QCOMPARE(plasmaWindowCreatedSpy.count(), 1);
|
||||||
auto window = plasmaWindowCreatedSpy.first().first().value<PlasmaWindow *>();
|
auto window = plasmaWindowCreatedSpy.first().first().value<KWayland::Client::PlasmaWindow *>();
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
QSignalSpy destroyedSpy(window, &QObject::destroyed);
|
QSignalSpy destroyedSpy(window, &QObject::destroyed);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
typedef std::function<QPointF(const QRectF &)> PointerFunc;
|
typedef std::function<QPointF(const QRectF &)> PointerFunc;
|
||||||
Q_DECLARE_METATYPE(PointerFunc)
|
Q_DECLARE_METATYPE(PointerFunc)
|
||||||
|
@ -123,10 +122,10 @@ void TestPointerConstraints::testConfinedPointer()
|
||||||
// simple interaction test to verify that the pointer gets confined
|
// simple interaction test to verify that the pointer gets confined
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<ConfinedPointer> confinedPointer(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot));
|
std::unique_ptr<KWayland::Client::ConfinedPointer> confinedPointer(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::OneShot));
|
||||||
QSignalSpy confinedSpy(confinedPointer.get(), &ConfinedPointer::confined);
|
QSignalSpy confinedSpy(confinedPointer.get(), &KWayland::Client::ConfinedPointer::confined);
|
||||||
QSignalSpy unconfinedSpy(confinedPointer.get(), &ConfinedPointer::unconfined);
|
QSignalSpy unconfinedSpy(confinedPointer.get(), &KWayland::Client::ConfinedPointer::unconfined);
|
||||||
|
|
||||||
// now map the window
|
// now map the window
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
||||||
|
@ -204,9 +203,9 @@ void TestPointerConstraints::testConfinedPointer()
|
||||||
QCOMPARE(input()->pointer()->isConstrained(), false);
|
QCOMPARE(input()->pointer()->isConstrained(), false);
|
||||||
|
|
||||||
// reconfine pointer (this time with persistent life time)
|
// reconfine pointer (this time with persistent life time)
|
||||||
confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent));
|
confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::Persistent));
|
||||||
QSignalSpy confinedSpy2(confinedPointer.get(), &ConfinedPointer::confined);
|
QSignalSpy confinedSpy2(confinedPointer.get(), &KWayland::Client::ConfinedPointer::confined);
|
||||||
QSignalSpy unconfinedSpy2(confinedPointer.get(), &ConfinedPointer::unconfined);
|
QSignalSpy unconfinedSpy2(confinedPointer.get(), &KWayland::Client::ConfinedPointer::unconfined);
|
||||||
|
|
||||||
// activate it again, this confines again
|
// activate it again, this confines again
|
||||||
workspace()->activateWindow(static_cast<Window *>(input()->pointer()->focus()));
|
workspace()->activateWindow(static_cast<Window *>(input()->pointer()->focus()));
|
||||||
|
@ -256,8 +255,8 @@ void TestPointerConstraints::testConfinedPointer()
|
||||||
QCOMPARE(input()->pointer()->isConstrained(), false);
|
QCOMPARE(input()->pointer()->isConstrained(), false);
|
||||||
|
|
||||||
// confine again
|
// confine again
|
||||||
confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent));
|
confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::Persistent));
|
||||||
QSignalSpy confinedSpy3(confinedPointer.get(), &ConfinedPointer::confined);
|
QSignalSpy confinedSpy3(confinedPointer.get(), &KWayland::Client::ConfinedPointer::confined);
|
||||||
QVERIFY(confinedSpy3.wait());
|
QVERIFY(confinedSpy3.wait());
|
||||||
QCOMPARE(input()->pointer()->isConstrained(), true);
|
QCOMPARE(input()->pointer()->isConstrained(), true);
|
||||||
|
|
||||||
|
@ -275,10 +274,10 @@ void TestPointerConstraints::testLockedPointer()
|
||||||
// the various ways to unlock are not tested as that's already verified by testConfinedPointer
|
// the various ways to unlock are not tested as that's already verified by testConfinedPointer
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<LockedPointer> lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot));
|
std::unique_ptr<KWayland::Client::LockedPointer> lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::OneShot));
|
||||||
QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked);
|
QSignalSpy lockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::locked);
|
||||||
QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked);
|
QSignalSpy unlockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::unlocked);
|
||||||
|
|
||||||
// now map the window
|
// now map the window
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
||||||
|
@ -306,8 +305,8 @@ void TestPointerConstraints::testLockedPointer()
|
||||||
KWin::Cursors::self()->mouse()->setPos(window->frameGeometry().center() + QPoint(1, 1));
|
KWin::Cursors::self()->mouse()->setPos(window->frameGeometry().center() + QPoint(1, 1));
|
||||||
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), window->frameGeometry().center() + QPoint(1, 1));
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), window->frameGeometry().center() + QPoint(1, 1));
|
||||||
|
|
||||||
lockedPointer.reset(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent));
|
lockedPointer.reset(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::Persistent));
|
||||||
QSignalSpy lockedSpy2(lockedPointer.get(), &LockedPointer::locked);
|
QSignalSpy lockedSpy2(lockedPointer.get(), &KWayland::Client::LockedPointer::locked);
|
||||||
|
|
||||||
// activate the window again, this should lock again
|
// activate the window again, this should lock again
|
||||||
workspace()->activateWindow(static_cast<Window *>(input()->pointer()->focus()));
|
workspace()->activateWindow(static_cast<Window *>(input()->pointer()->focus()));
|
||||||
|
@ -337,10 +336,10 @@ void TestPointerConstraints::testCloseWindowWithLockedPointer()
|
||||||
// test case which verifies that the pointer gets unlocked when the window for it gets closed
|
// test case which verifies that the pointer gets unlocked when the window for it gets closed
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<LockedPointer> lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot));
|
std::unique_ptr<KWayland::Client::LockedPointer> lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::OneShot));
|
||||||
QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked);
|
QSignalSpy lockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::locked);
|
||||||
QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked);
|
QSignalSpy unlockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::unlocked);
|
||||||
|
|
||||||
// now map the window
|
// now map the window
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
|
||||||
|
|
|
@ -184,13 +184,13 @@ void PointerInputTest::render(KWayland::Client::Surface *surface, const QSize &s
|
||||||
void PointerInputTest::testWarpingUpdatesFocus()
|
void PointerInputTest::testWarpingUpdatesFocus()
|
||||||
{
|
{
|
||||||
// this test verifies that warping the pointer creates pointer enter and leave events
|
// this test verifies that warping the pointer creates pointer enter and leave events
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for enter and leave signals
|
// create pointer and signal spy for enter and leave signals
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
|
@ -229,13 +229,13 @@ void PointerInputTest::testWarpingUpdatesFocus()
|
||||||
void PointerInputTest::testWarpingGeneratesPointerMotion()
|
void PointerInputTest::testWarpingGeneratesPointerMotion()
|
||||||
{
|
{
|
||||||
// this test verifies that warping the pointer creates pointer motion events
|
// this test verifies that warping the pointer creates pointer motion events
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for enter and motion
|
// create pointer and signal spy for enter and motion
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy movedSpy(pointer, &Pointer::motion);
|
QSignalSpy movedSpy(pointer, &KWayland::Client::Pointer::motion);
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
|
@ -264,13 +264,12 @@ void PointerInputTest::testWarpingDuringFilter()
|
||||||
{
|
{
|
||||||
// this test verifies that pointer motion is handled correctly if
|
// this test verifies that pointer motion is handled correctly if
|
||||||
// the pointer gets warped during processing of input events
|
// the pointer gets warped during processing of input events
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// create pointer
|
// create pointer
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy movedSpy(pointer, &Pointer::motion);
|
QSignalSpy movedSpy(pointer, &KWayland::Client::Pointer::motion);
|
||||||
|
|
||||||
// warp cursor into expected geometry
|
// warp cursor into expected geometry
|
||||||
Cursors::self()->mouse()->setPos(10, 10);
|
Cursors::self()->mouse()->setPos(10, 10);
|
||||||
|
@ -349,14 +348,13 @@ void PointerInputTest::testUpdateFocusAfterScreenChange()
|
||||||
{
|
{
|
||||||
// this test verifies that a pointer enter event is generated when the cursor changes to another
|
// this test verifies that a pointer enter event is generated when the cursor changes to another
|
||||||
// screen due to removal of screen
|
// screen due to removal of screen
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// create pointer and signal spy for enter and motion
|
// create pointer and signal spy for enter and motion
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
|
|
||||||
// create a window
|
// create a window
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
|
@ -525,12 +523,12 @@ void PointerInputTest::testModifierClickUnrestrictedMove_data()
|
||||||
void PointerInputTest::testModifierClickUnrestrictedMove()
|
void PointerInputTest::testModifierClickUnrestrictedMove()
|
||||||
{
|
{
|
||||||
// this test ensures that Alt+mouse button press triggers unrestricted move
|
// this test ensures that Alt+mouse button press triggers unrestricted move
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for button events
|
// create pointer and signal spy for button events
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged);
|
QSignalSpy buttonSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
|
|
||||||
// first modify the config for this run
|
// first modify the config for this run
|
||||||
QFETCH(QString, modKey);
|
QFETCH(QString, modKey);
|
||||||
|
@ -642,12 +640,12 @@ void PointerInputTest::testModifierClickUnrestrictedFullscreenMove()
|
||||||
void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled()
|
void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled()
|
||||||
{
|
{
|
||||||
// this test ensures that Alt+mouse button press triggers unrestricted move
|
// this test ensures that Alt+mouse button press triggers unrestricted move
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for button events
|
// create pointer and signal spy for button events
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged);
|
QSignalSpy buttonSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
|
|
||||||
// first modify the config for this run
|
// first modify the config for this run
|
||||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||||
|
@ -718,12 +716,12 @@ void PointerInputTest::testModifierScrollOpacity()
|
||||||
{
|
{
|
||||||
// this test verifies that mod+wheel performs a window operation and does not
|
// this test verifies that mod+wheel performs a window operation and does not
|
||||||
// pass the wheel to the window
|
// pass the wheel to the window
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for button events
|
// create pointer and signal spy for button events
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy axisSpy(pointer, &Pointer::axisChanged);
|
QSignalSpy axisSpy(pointer, &KWayland::Client::Pointer::axisChanged);
|
||||||
|
|
||||||
// first modify the config for this run
|
// first modify the config for this run
|
||||||
QFETCH(QString, modKey);
|
QFETCH(QString, modKey);
|
||||||
|
@ -776,12 +774,12 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
|
||||||
{
|
{
|
||||||
// this test verifies that mod+wheel performs a window operation and does not
|
// this test verifies that mod+wheel performs a window operation and does not
|
||||||
// pass the wheel to the window
|
// pass the wheel to the window
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create pointer and signal spy for button events
|
// create pointer and signal spy for button events
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy axisSpy(pointer, &Pointer::axisChanged);
|
QSignalSpy axisSpy(pointer, &KWayland::Client::Pointer::axisChanged);
|
||||||
|
|
||||||
// first modify the config for this run
|
// first modify the config for this run
|
||||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||||
|
@ -827,11 +825,10 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
|
||||||
void PointerInputTest::testScrollAction()
|
void PointerInputTest::testScrollAction()
|
||||||
{
|
{
|
||||||
// this test verifies that scroll on inactive window performs a mouse action
|
// this test verifies that scroll on inactive window performs a mouse action
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy axisSpy(pointer, &Pointer::axisChanged);
|
QSignalSpy axisSpy(pointer, &KWayland::Client::Pointer::axisChanged);
|
||||||
|
|
||||||
// first modify the config for this run
|
// first modify the config for this run
|
||||||
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
|
||||||
|
@ -875,7 +872,6 @@ void PointerInputTest::testScrollAction()
|
||||||
|
|
||||||
void PointerInputTest::testFocusFollowsMouse()
|
void PointerInputTest::testFocusFollowsMouse()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
// need to create a pointer, otherwise it doesn't accept focus
|
// need to create a pointer, otherwise it doesn't accept focus
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
|
@ -967,7 +963,6 @@ void PointerInputTest::testMouseActionInactiveWindow()
|
||||||
{
|
{
|
||||||
// this test performs the mouse button window action on an inactive window
|
// this test performs the mouse button window action on an inactive window
|
||||||
// it should activate the window and raise it
|
// it should activate the window and raise it
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// first modify the config for this run - disable FocusFollowsMouse
|
// first modify the config for this run - disable FocusFollowsMouse
|
||||||
KConfigGroup group = kwinApp()->config()->group("Windows");
|
KConfigGroup group = kwinApp()->config()->group("Windows");
|
||||||
|
@ -1051,12 +1046,12 @@ void PointerInputTest::testMouseActionActiveWindow()
|
||||||
// this test verifies the mouse action performed on an active window
|
// this test verifies the mouse action performed on an active window
|
||||||
// for all buttons it should trigger a window raise depending on the
|
// for all buttons it should trigger a window raise depending on the
|
||||||
// click raise option
|
// click raise option
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create a button spy - all clicks should be passed through
|
// create a button spy - all clicks should be passed through
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged);
|
QSignalSpy buttonSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
|
|
||||||
// adjust config for this run
|
// adjust config for this run
|
||||||
QFETCH(bool, clickRaise);
|
QFETCH(bool, clickRaise);
|
||||||
|
@ -1128,12 +1123,12 @@ void PointerInputTest::testMouseActionActiveWindow()
|
||||||
void PointerInputTest::testCursorImage()
|
void PointerInputTest::testCursorImage()
|
||||||
{
|
{
|
||||||
// this test verifies that the pointer image gets updated correctly from the client provided data
|
// this test verifies that the pointer image gets updated correctly from the client provided data
|
||||||
using namespace KWayland::Client;
|
|
||||||
// we need a pointer to get the enter event
|
// we need a pointer to get the enter event
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
|
|
||||||
// move cursor somewhere the new window won't open
|
// move cursor somewhere the new window won't open
|
||||||
auto cursor = Cursors::self()->mouse();
|
auto cursor = Cursors::self()->mouse();
|
||||||
|
@ -1230,14 +1225,14 @@ public:
|
||||||
void PointerInputTest::testEffectOverrideCursorImage()
|
void PointerInputTest::testEffectOverrideCursorImage()
|
||||||
{
|
{
|
||||||
// this test verifies the effect cursor override handling
|
// this test verifies the effect cursor override handling
|
||||||
using namespace KWayland::Client;
|
|
||||||
// we need a pointer to get the enter event and set a cursor
|
// we need a pointer to get the enter event and set a cursor
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
auto cursor = Cursors::self()->mouse();
|
auto cursor = Cursors::self()->mouse();
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
// move cursor somewhere the new window won't open
|
// move cursor somewhere the new window won't open
|
||||||
cursor->setPos(800, 800);
|
cursor->setPos(800, 800);
|
||||||
// here we should have the fallback cursor
|
// here we should have the fallback cursor
|
||||||
|
@ -1305,14 +1300,13 @@ void PointerInputTest::testPopup()
|
||||||
// a button press outside the window should dismiss the popup
|
// a button press outside the window should dismiss the popup
|
||||||
|
|
||||||
// first create a parent surface
|
// first create a parent surface
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy buttonStateChangedSpy(pointer, &Pointer::buttonStateChanged);
|
QSignalSpy buttonStateChangedSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
QSignalSpy motionSpy(pointer, &Pointer::motion);
|
QSignalSpy motionSpy(pointer, &KWayland::Client::Pointer::motion);
|
||||||
|
|
||||||
Cursors::self()->mouse()->setPos(800, 800);
|
Cursors::self()->mouse()->setPos(800, 800);
|
||||||
|
|
||||||
|
@ -1342,7 +1336,7 @@ void PointerInputTest::testPopup()
|
||||||
positioner->set_anchor_rect(0, 0, 80, 20);
|
positioner->set_anchor_rect(0, 0, 80, 20);
|
||||||
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
||||||
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
||||||
std::unique_ptr<Surface> popupSurface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> popupSurface = Test::createSurface();
|
||||||
QVERIFY(popupSurface);
|
QVERIFY(popupSurface);
|
||||||
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
|
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
|
||||||
QVERIFY(popupShellSurface);
|
QVERIFY(popupShellSurface);
|
||||||
|
@ -1383,14 +1377,13 @@ void PointerInputTest::testDecoCancelsPopup()
|
||||||
// cancels the popup
|
// cancels the popup
|
||||||
|
|
||||||
// first create a parent surface
|
// first create a parent surface
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy buttonStateChangedSpy(pointer, &Pointer::buttonStateChanged);
|
QSignalSpy buttonStateChangedSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged);
|
||||||
QSignalSpy motionSpy(pointer, &Pointer::motion);
|
QSignalSpy motionSpy(pointer, &KWayland::Client::Pointer::motion);
|
||||||
|
|
||||||
Cursors::self()->mouse()->setPos(800, 800);
|
Cursors::self()->mouse()->setPos(800, 800);
|
||||||
|
|
||||||
|
@ -1424,7 +1417,7 @@ void PointerInputTest::testDecoCancelsPopup()
|
||||||
positioner->set_anchor_rect(0, 0, 80, 20);
|
positioner->set_anchor_rect(0, 0, 80, 20);
|
||||||
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
||||||
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
||||||
std::unique_ptr<Surface> popupSurface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> popupSurface = Test::createSurface();
|
||||||
QVERIFY(popupSurface);
|
QVERIFY(popupSurface);
|
||||||
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
|
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
|
||||||
QVERIFY(popupShellSurface);
|
QVERIFY(popupShellSurface);
|
||||||
|
@ -1453,12 +1446,11 @@ void PointerInputTest::testWindowUnderCursorWhileButtonPressed()
|
||||||
// see BUG: 372876
|
// see BUG: 372876
|
||||||
|
|
||||||
// first create a parent surface
|
// first create a parent surface
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto pointer = m_seat->createPointer(m_seat);
|
auto pointer = m_seat->createPointer(m_seat);
|
||||||
QVERIFY(pointer);
|
QVERIFY(pointer);
|
||||||
QVERIFY(pointer->isValid());
|
QVERIFY(pointer->isValid());
|
||||||
QSignalSpy enteredSpy(pointer, &Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy leftSpy(pointer, &Pointer::left);
|
QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left);
|
||||||
|
|
||||||
Cursors::self()->mouse()->setPos(800, 800);
|
Cursors::self()->mouse()->setPos(800, 800);
|
||||||
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
|
||||||
|
@ -1485,7 +1477,7 @@ void PointerInputTest::testWindowUnderCursorWhileButtonPressed()
|
||||||
positioner->set_anchor_rect(0, 0, 1, 1);
|
positioner->set_anchor_rect(0, 0, 1, 1);
|
||||||
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right);
|
||||||
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right);
|
||||||
std::unique_ptr<Surface> popupSurface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> popupSurface = Test::createSurface();
|
||||||
QVERIFY(popupSurface);
|
QVERIFY(popupSurface);
|
||||||
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
|
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
|
||||||
QVERIFY(popupShellSurface);
|
QVERIFY(popupShellSurface);
|
||||||
|
@ -1638,7 +1630,6 @@ void PointerInputTest::testResizeCursor()
|
||||||
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
|
|
||||||
// create a test window
|
// create a test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -1726,7 +1717,6 @@ void PointerInputTest::testMoveCursor()
|
||||||
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
|
||||||
|
|
||||||
// create a test window
|
// create a test window
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -1798,7 +1788,6 @@ void PointerInputTest::testDefaultInputRegion()
|
||||||
// This test verifies that a surface that hasn't specified the input region can be focused.
|
// This test verifies that a surface that hasn't specified the input region can be focused.
|
||||||
|
|
||||||
// Create a test window.
|
// Create a test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -1820,7 +1809,6 @@ void PointerInputTest::testEmptyInputRegion()
|
||||||
// This test verifies that a surface that has specified an empty input region can't be focused.
|
// This test verifies that a surface that has specified an empty input region can't be focused.
|
||||||
|
|
||||||
// Create a test window.
|
// Create a test window.
|
||||||
using namespace KWayland::Client;
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<KWayland::Client::Region> inputRegion(m_compositor->createRegion(QRegion()));
|
std::unique_ptr<KWayland::Client::Region> inputRegion(m_compositor->createRegion(QRegion()));
|
||||||
|
|
|
@ -147,8 +147,6 @@ void QuickTilingTest::testQuickTiling_data()
|
||||||
|
|
||||||
void QuickTilingTest::testQuickTiling()
|
void QuickTilingTest::testQuickTiling()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -220,8 +218,6 @@ void QuickTilingTest::testQuickMaximizing_data()
|
||||||
|
|
||||||
void QuickTilingTest::testQuickMaximizing()
|
void QuickTilingTest::testQuickMaximizing()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -324,8 +320,6 @@ void QuickTilingTest::testQuickTilingKeyboardMove_data()
|
||||||
|
|
||||||
void QuickTilingTest::testQuickTilingKeyboardMove()
|
void QuickTilingTest::testQuickTilingKeyboardMove()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
|
|
||||||
|
@ -391,8 +385,6 @@ void QuickTilingTest::testQuickTilingPointerMove_data()
|
||||||
|
|
||||||
void QuickTilingTest::testQuickTilingPointerMove()
|
void QuickTilingTest::testQuickTilingPointerMove()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
|
||||||
|
@ -470,11 +462,10 @@ void QuickTilingTest::testQuickTilingTouchMove()
|
||||||
{
|
{
|
||||||
// test verifies that touch on decoration also allows quick tiling
|
// test verifies that touch on decoration also allows quick tiling
|
||||||
// see BUG: 390113
|
// see BUG: 390113
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.get()));
|
std::unique_ptr<KWayland::Client::ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.get()));
|
||||||
|
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
||||||
QVERIFY(shellSurface != nullptr);
|
QVERIFY(shellSurface != nullptr);
|
||||||
|
@ -717,8 +708,6 @@ void QuickTilingTest::testShortcut_data()
|
||||||
|
|
||||||
void QuickTilingTest::testShortcut()
|
void QuickTilingTest::testShortcut()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
@ -800,8 +789,6 @@ void QuickTilingTest::testScript_data()
|
||||||
|
|
||||||
void QuickTilingTest::testScript()
|
void QuickTilingTest::testScript()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include <KWayland/Client/xdgoutput.h>
|
#include <KWayland/Client/xdgoutput.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_screen_changes-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_screen_changes-0");
|
||||||
|
|
||||||
|
@ -64,15 +63,15 @@ void ScreenChangesTest::testScreenAddRemove()
|
||||||
// this test verifies that when a new screen is added it gets synced to Wayland
|
// this test verifies that when a new screen is added it gets synced to Wayland
|
||||||
|
|
||||||
// first create a registry to get signals about Outputs announced/removed
|
// first create a registry to get signals about Outputs announced/removed
|
||||||
Registry registry;
|
KWayland::Client::Registry registry;
|
||||||
QSignalSpy allAnnounced(®istry, &Registry::interfacesAnnounced);
|
QSignalSpy allAnnounced(®istry, &KWayland::Client::Registry::interfacesAnnounced);
|
||||||
QSignalSpy outputAnnouncedSpy(®istry, &Registry::outputAnnounced);
|
QSignalSpy outputAnnouncedSpy(®istry, &KWayland::Client::Registry::outputAnnounced);
|
||||||
QSignalSpy outputRemovedSpy(®istry, &Registry::outputRemoved);
|
QSignalSpy outputRemovedSpy(®istry, &KWayland::Client::Registry::outputRemoved);
|
||||||
registry.create(Test::waylandConnection());
|
registry.create(Test::waylandConnection());
|
||||||
QVERIFY(registry.isValid());
|
QVERIFY(registry.isValid());
|
||||||
registry.setup();
|
registry.setup();
|
||||||
QVERIFY(allAnnounced.wait());
|
QVERIFY(allAnnounced.wait());
|
||||||
const auto xdgOMData = registry.interface(Registry::Interface::XdgOutputUnstableV1);
|
const auto xdgOMData = registry.interface(KWayland::Client::Registry::Interface::XdgOutputUnstableV1);
|
||||||
auto xdgOutputManager = registry.createXdgOutputManager(xdgOMData.name, xdgOMData.version);
|
auto xdgOutputManager = registry.createXdgOutputManager(xdgOMData.name, xdgOMData.version);
|
||||||
|
|
||||||
// should be one output
|
// should be one output
|
||||||
|
@ -128,13 +127,13 @@ void ScreenChangesTest::testScreenAddRemove()
|
||||||
QCOMPARE(o2->pixelSize(), serverOutput2->modeSize());
|
QCOMPARE(o2->pixelSize(), serverOutput2->modeSize());
|
||||||
|
|
||||||
// and check XDGOutput is synced
|
// and check XDGOutput is synced
|
||||||
std::unique_ptr<XdgOutput> xdgO1(xdgOutputManager->getXdgOutput(o1.get()));
|
std::unique_ptr<KWayland::Client::XdgOutput> xdgO1(xdgOutputManager->getXdgOutput(o1.get()));
|
||||||
QSignalSpy xdgO1ChangedSpy(xdgO1.get(), &XdgOutput::changed);
|
QSignalSpy xdgO1ChangedSpy(xdgO1.get(), &KWayland::Client::XdgOutput::changed);
|
||||||
QVERIFY(xdgO1ChangedSpy.wait());
|
QVERIFY(xdgO1ChangedSpy.wait());
|
||||||
QCOMPARE(xdgO1->logicalPosition(), serverOutput1->geometry().topLeft());
|
QCOMPARE(xdgO1->logicalPosition(), serverOutput1->geometry().topLeft());
|
||||||
QCOMPARE(xdgO1->logicalSize(), serverOutput1->geometry().size());
|
QCOMPARE(xdgO1->logicalSize(), serverOutput1->geometry().size());
|
||||||
std::unique_ptr<XdgOutput> xdgO2(xdgOutputManager->getXdgOutput(o2.get()));
|
std::unique_ptr<KWayland::Client::XdgOutput> xdgO2(xdgOutputManager->getXdgOutput(o2.get()));
|
||||||
QSignalSpy xdgO2ChangedSpy(xdgO2.get(), &XdgOutput::changed);
|
QSignalSpy xdgO2ChangedSpy(xdgO2.get(), &KWayland::Client::XdgOutput::changed);
|
||||||
QVERIFY(xdgO2ChangedSpy.wait());
|
QVERIFY(xdgO2ChangedSpy.wait());
|
||||||
QCOMPARE(xdgO2->logicalPosition(), serverOutput2->geometry().topLeft());
|
QCOMPARE(xdgO2->logicalPosition(), serverOutput2->geometry().topLeft());
|
||||||
QCOMPARE(xdgO2->logicalSize(), serverOutput2->geometry().size());
|
QCOMPARE(xdgO2->logicalSize(), serverOutput2->geometry().size());
|
||||||
|
|
|
@ -102,8 +102,6 @@ void MinimizeAllScriptTest::testMinimizeUnminimize()
|
||||||
// This test verifies that all windows are minimized when Meta+Shift+D
|
// This test verifies that all windows are minimized when Meta+Shift+D
|
||||||
// is pressed, and unminimized when the shortcut is pressed once again.
|
// is pressed, and unminimized when the shortcut is pressed once again.
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// Create a couple of test windows.
|
// Create a couple of test windows.
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface1(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface1(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface1(Test::createXdgToplevelSurface(surface1.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface1(Test::createXdgToplevelSurface(surface1.get()));
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include <KWayland/Client/surface.h>
|
#include <KWayland/Client/surface.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_showing_desktop-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_showing_desktop-0");
|
||||||
|
|
||||||
|
@ -82,9 +81,9 @@ void ShowingDesktopTest::testRestoreFocusWithDesktopWindow()
|
||||||
QVERIFY(desktopSurface != nullptr);
|
QVERIFY(desktopSurface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> desktopShellSurface(Test::createXdgToplevelSurface(desktopSurface.get()));
|
std::unique_ptr<Test::XdgToplevel> desktopShellSurface(Test::createXdgToplevelSurface(desktopSurface.get()));
|
||||||
QVERIFY(desktopSurface != nullptr);
|
QVERIFY(desktopSurface != nullptr);
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(desktopSurface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(desktopSurface.get()));
|
||||||
QVERIFY(plasmaSurface != nullptr);
|
QVERIFY(plasmaSurface != nullptr);
|
||||||
plasmaSurface->setRole(PlasmaShellSurface::Role::Desktop);
|
plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Desktop);
|
||||||
|
|
||||||
auto desktop = Test::renderAndWaitForShown(desktopSurface.get(), QSize(100, 50), Qt::blue);
|
auto desktop = Test::renderAndWaitForShown(desktopSurface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(desktop);
|
QVERIFY(desktop);
|
||||||
|
|
|
@ -134,7 +134,6 @@ void StrutsTest::testWaylandStruts_data()
|
||||||
void StrutsTest::testWaylandStruts()
|
void StrutsTest::testWaylandStruts()
|
||||||
{
|
{
|
||||||
// this test verifies that struts on Wayland panels are handled correctly
|
// this test verifies that struts on Wayland panels are handled correctly
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||||
const QList<Output *> outputs = workspace()->outputs();
|
const QList<Output *> outputs = workspace()->outputs();
|
||||||
|
@ -167,9 +166,9 @@ void StrutsTest::testWaylandStruts()
|
||||||
const QRect windowGeometry = *it;
|
const QRect windowGeometry = *it;
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
|
||||||
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly, surface.get());
|
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly, surface.get());
|
||||||
PlasmaShellSurface *plasmaSurface = m_plasmaShell->createSurface(surface.get(), surface.get());
|
KWayland::Client::PlasmaShellSurface *plasmaSurface = m_plasmaShell->createSurface(surface.get(), surface.get());
|
||||||
plasmaSurface->setPosition(windowGeometry.topLeft());
|
plasmaSurface->setPosition(windowGeometry.topLeft());
|
||||||
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
|
|
||||||
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
||||||
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
|
@ -225,13 +224,12 @@ void StrutsTest::testMoveWaylandPanel()
|
||||||
const QList<Output *> outputs = workspace()->outputs();
|
const QList<Output *> outputs = workspace()->outputs();
|
||||||
|
|
||||||
// this test verifies that repositioning a Wayland panel updates the client area
|
// this test verifies that repositioning a Wayland panel updates the client area
|
||||||
using namespace KWayland::Client;
|
|
||||||
const QRect windowGeometry(0, 1000, 1280, 24);
|
const QRect windowGeometry(0, 1000, 1280, 24);
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(surface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(surface.get()));
|
||||||
plasmaSurface->setPosition(windowGeometry.topLeft());
|
plasmaSurface->setPosition(windowGeometry.topLeft());
|
||||||
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
|
|
||||||
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
||||||
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
|
@ -264,8 +262,6 @@ void StrutsTest::testMoveWaylandPanel()
|
||||||
|
|
||||||
void StrutsTest::testWaylandMobilePanel()
|
void StrutsTest::testWaylandMobilePanel()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop();
|
||||||
const QList<Output *> outputs = workspace()->outputs();
|
const QList<Output *> outputs = workspace()->outputs();
|
||||||
|
|
||||||
|
@ -279,9 +275,9 @@ void StrutsTest::testWaylandMobilePanel()
|
||||||
const QRect windowGeometry(0, 0, 1280, 60);
|
const QRect windowGeometry(0, 0, 1280, 60);
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(surface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(surface.get()));
|
||||||
plasmaSurface->setPosition(windowGeometry.topLeft());
|
plasmaSurface->setPosition(windowGeometry.topLeft());
|
||||||
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
|
|
||||||
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
||||||
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
|
@ -306,9 +302,9 @@ void StrutsTest::testWaylandMobilePanel()
|
||||||
const QRect windowGeometry2(0, 874, 1280, 150);
|
const QRect windowGeometry2(0, 874, 1280, 150);
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface2(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface2(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface2(Test::createXdgToplevelSurface(surface2.get(), Test::CreationSetup::CreateOnly));
|
std::unique_ptr<Test::XdgToplevel> shellSurface2(Test::createXdgToplevelSurface(surface2.get(), Test::CreationSetup::CreateOnly));
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface2(m_plasmaShell->createSurface(surface2.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface2(m_plasmaShell->createSurface(surface2.get()));
|
||||||
plasmaSurface2->setPosition(windowGeometry2.topLeft());
|
plasmaSurface2->setPosition(windowGeometry2.topLeft());
|
||||||
plasmaSurface2->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaSurface2->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
|
|
||||||
QSignalSpy configureRequestedSpy2(shellSurface2->xdgSurface(), &Test::XdgSurface::configureRequested);
|
QSignalSpy configureRequestedSpy2(shellSurface2->xdgSurface(), &Test::XdgSurface::configureRequested);
|
||||||
surface2->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface2->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_tabbox-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_tabbox-0");
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,6 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
namespace Test
|
namespace Test
|
||||||
|
@ -227,27 +225,27 @@ IdleInhibitorV1::~IdleInhibitorV1()
|
||||||
|
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
ConnectionThread *connection = nullptr;
|
KWayland::Client::ConnectionThread *connection = nullptr;
|
||||||
EventQueue *queue = nullptr;
|
KWayland::Client::EventQueue *queue = nullptr;
|
||||||
KWayland::Client::Compositor *compositor = nullptr;
|
KWayland::Client::Compositor *compositor = nullptr;
|
||||||
SubCompositor *subCompositor = nullptr;
|
KWayland::Client::SubCompositor *subCompositor = nullptr;
|
||||||
ServerSideDecorationManager *decoration = nullptr;
|
KWayland::Client::ServerSideDecorationManager *decoration = nullptr;
|
||||||
ShadowManager *shadowManager = nullptr;
|
KWayland::Client::ShadowManager *shadowManager = nullptr;
|
||||||
XdgShell *xdgShell = nullptr;
|
XdgShell *xdgShell = nullptr;
|
||||||
ShmPool *shm = nullptr;
|
KWayland::Client::ShmPool *shm = nullptr;
|
||||||
Seat *seat = nullptr;
|
KWayland::Client::Seat *seat = nullptr;
|
||||||
PlasmaShell *plasmaShell = nullptr;
|
KWayland::Client::PlasmaShell *plasmaShell = nullptr;
|
||||||
PlasmaWindowManagement *windowManagement = nullptr;
|
KWayland::Client::PlasmaWindowManagement *windowManagement = nullptr;
|
||||||
PointerConstraints *pointerConstraints = nullptr;
|
KWayland::Client::PointerConstraints *pointerConstraints = nullptr;
|
||||||
Registry *registry = nullptr;
|
KWayland::Client::Registry *registry = nullptr;
|
||||||
WaylandOutputManagementV2 *outputManagementV2 = nullptr;
|
WaylandOutputManagementV2 *outputManagementV2 = nullptr;
|
||||||
QThread *thread = nullptr;
|
QThread *thread = nullptr;
|
||||||
QVector<KWayland::Client::Output *> outputs;
|
QVector<KWayland::Client::Output *> outputs;
|
||||||
QVector<WaylandOutputDeviceV2 *> outputDevicesV2;
|
QVector<WaylandOutputDeviceV2 *> outputDevicesV2;
|
||||||
IdleInhibitManagerV1 *idleInhibitManagerV1 = nullptr;
|
IdleInhibitManagerV1 *idleInhibitManagerV1 = nullptr;
|
||||||
AppMenuManager *appMenu = nullptr;
|
KWayland::Client::AppMenuManager *appMenu = nullptr;
|
||||||
XdgDecorationManagerV1 *xdgDecorationManagerV1 = nullptr;
|
XdgDecorationManagerV1 *xdgDecorationManagerV1 = nullptr;
|
||||||
TextInputManager *textInputManager = nullptr;
|
KWayland::Client::TextInputManager *textInputManager = nullptr;
|
||||||
QtWayland::zwp_input_panel_v1 *inputPanelV1 = nullptr;
|
QtWayland::zwp_input_panel_v1 *inputPanelV1 = nullptr;
|
||||||
MockInputMethod *inputMethodV1 = nullptr;
|
MockInputMethod *inputMethodV1 = nullptr;
|
||||||
QtWayland::zwp_input_method_context_v1 *inputMethodContextV1 = nullptr;
|
QtWayland::zwp_input_method_context_v1 *inputMethodContextV1 = nullptr;
|
||||||
|
@ -312,8 +310,8 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
||||||
}
|
}
|
||||||
KWin::waylandServer()->display()->createClient(sx[0]);
|
KWin::waylandServer()->display()->createClient(sx[0]);
|
||||||
// setup connection
|
// setup connection
|
||||||
s_waylandConnection.connection = new ConnectionThread;
|
s_waylandConnection.connection = new KWayland::Client::ConnectionThread;
|
||||||
QSignalSpy connectedSpy(s_waylandConnection.connection, &ConnectionThread::connected);
|
QSignalSpy connectedSpy(s_waylandConnection.connection, &KWayland::Client::ConnectionThread::connected);
|
||||||
if (!connectedSpy.isValid()) {
|
if (!connectedSpy.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -328,17 +326,17 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_waylandConnection.queue = new EventQueue;
|
s_waylandConnection.queue = new KWayland::Client::EventQueue;
|
||||||
s_waylandConnection.queue->setup(s_waylandConnection.connection);
|
s_waylandConnection.queue->setup(s_waylandConnection.connection);
|
||||||
if (!s_waylandConnection.queue->isValid()) {
|
if (!s_waylandConnection.queue->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Registry *registry = new Registry;
|
KWayland::Client::Registry *registry = new KWayland::Client::Registry;
|
||||||
s_waylandConnection.registry = registry;
|
s_waylandConnection.registry = registry;
|
||||||
registry->setEventQueue(s_waylandConnection.queue);
|
registry->setEventQueue(s_waylandConnection.queue);
|
||||||
|
|
||||||
QObject::connect(registry, &Registry::outputAnnounced, [=](quint32 name, quint32 version) {
|
QObject::connect(registry, &KWayland::Client::Registry::outputAnnounced, [=](quint32 name, quint32 version) {
|
||||||
KWayland::Client::Output *output = registry->createOutput(name, version, s_waylandConnection.registry);
|
KWayland::Client::Output *output = registry->createOutput(name, version, s_waylandConnection.registry);
|
||||||
s_waylandConnection.outputs << output;
|
s_waylandConnection.outputs << output;
|
||||||
QObject::connect(output, &KWayland::Client::Output::removed, [=]() {
|
QObject::connect(output, &KWayland::Client::Output::removed, [=]() {
|
||||||
|
@ -350,7 +348,7 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(registry, &Registry::interfaceAnnounced, [=](const QByteArray &interface, quint32 name, quint32 version) {
|
QObject::connect(registry, &KWayland::Client::Registry::interfaceAnnounced, [=](const QByteArray &interface, quint32 name, quint32 version) {
|
||||||
if (flags & AdditionalWaylandInterface::InputMethodV1) {
|
if (flags & AdditionalWaylandInterface::InputMethodV1) {
|
||||||
if (interface == QByteArrayLiteral("zwp_input_method_v1")) {
|
if (interface == QByteArrayLiteral("zwp_input_method_v1")) {
|
||||||
s_waylandConnection.inputMethodV1 = new MockInputMethod(*registry, name, version);
|
s_waylandConnection.inputMethodV1 = new MockInputMethod(*registry, name, version);
|
||||||
|
@ -419,7 +417,7 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
QSignalSpy allAnnounced(registry, &Registry::interfacesAnnounced);
|
QSignalSpy allAnnounced(registry, &KWayland::Client::Registry::interfacesAnnounced);
|
||||||
if (!allAnnounced.isValid()) {
|
if (!allAnnounced.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -432,67 +430,67 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_waylandConnection.compositor = registry->createCompositor(registry->interface(Registry::Interface::Compositor).name, registry->interface(Registry::Interface::Compositor).version);
|
s_waylandConnection.compositor = registry->createCompositor(registry->interface(KWayland::Client::Registry::Interface::Compositor).name, registry->interface(KWayland::Client::Registry::Interface::Compositor).version);
|
||||||
if (!s_waylandConnection.compositor->isValid()) {
|
if (!s_waylandConnection.compositor->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
s_waylandConnection.subCompositor = registry->createSubCompositor(registry->interface(Registry::Interface::SubCompositor).name, registry->interface(Registry::Interface::SubCompositor).version);
|
s_waylandConnection.subCompositor = registry->createSubCompositor(registry->interface(KWayland::Client::Registry::Interface::SubCompositor).name, registry->interface(KWayland::Client::Registry::Interface::SubCompositor).version);
|
||||||
if (!s_waylandConnection.subCompositor->isValid()) {
|
if (!s_waylandConnection.subCompositor->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
s_waylandConnection.shm = registry->createShmPool(registry->interface(Registry::Interface::Shm).name, registry->interface(Registry::Interface::Shm).version);
|
s_waylandConnection.shm = registry->createShmPool(registry->interface(KWayland::Client::Registry::Interface::Shm).name, registry->interface(KWayland::Client::Registry::Interface::Shm).version);
|
||||||
if (!s_waylandConnection.shm->isValid()) {
|
if (!s_waylandConnection.shm->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::Seat)) {
|
if (flags.testFlag(AdditionalWaylandInterface::Seat)) {
|
||||||
s_waylandConnection.seat = registry->createSeat(registry->interface(Registry::Interface::Seat).name, registry->interface(Registry::Interface::Seat).version);
|
s_waylandConnection.seat = registry->createSeat(registry->interface(KWayland::Client::Registry::Interface::Seat).name, registry->interface(KWayland::Client::Registry::Interface::Seat).version);
|
||||||
if (!s_waylandConnection.seat->isValid()) {
|
if (!s_waylandConnection.seat->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::ShadowManager)) {
|
if (flags.testFlag(AdditionalWaylandInterface::ShadowManager)) {
|
||||||
s_waylandConnection.shadowManager = registry->createShadowManager(registry->interface(Registry::Interface::Shadow).name,
|
s_waylandConnection.shadowManager = registry->createShadowManager(registry->interface(KWayland::Client::Registry::Interface::Shadow).name,
|
||||||
registry->interface(Registry::Interface::Shadow).version);
|
registry->interface(KWayland::Client::Registry::Interface::Shadow).version);
|
||||||
if (!s_waylandConnection.shadowManager->isValid()) {
|
if (!s_waylandConnection.shadowManager->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::Decoration)) {
|
if (flags.testFlag(AdditionalWaylandInterface::Decoration)) {
|
||||||
s_waylandConnection.decoration = registry->createServerSideDecorationManager(registry->interface(Registry::Interface::ServerSideDecorationManager).name,
|
s_waylandConnection.decoration = registry->createServerSideDecorationManager(registry->interface(KWayland::Client::Registry::Interface::ServerSideDecorationManager).name,
|
||||||
registry->interface(Registry::Interface::ServerSideDecorationManager).version);
|
registry->interface(KWayland::Client::Registry::Interface::ServerSideDecorationManager).version);
|
||||||
if (!s_waylandConnection.decoration->isValid()) {
|
if (!s_waylandConnection.decoration->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::PlasmaShell)) {
|
if (flags.testFlag(AdditionalWaylandInterface::PlasmaShell)) {
|
||||||
s_waylandConnection.plasmaShell = registry->createPlasmaShell(registry->interface(Registry::Interface::PlasmaShell).name,
|
s_waylandConnection.plasmaShell = registry->createPlasmaShell(registry->interface(KWayland::Client::Registry::Interface::PlasmaShell).name,
|
||||||
registry->interface(Registry::Interface::PlasmaShell).version);
|
registry->interface(KWayland::Client::Registry::Interface::PlasmaShell).version);
|
||||||
if (!s_waylandConnection.plasmaShell->isValid()) {
|
if (!s_waylandConnection.plasmaShell->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::WindowManagement)) {
|
if (flags.testFlag(AdditionalWaylandInterface::WindowManagement)) {
|
||||||
s_waylandConnection.windowManagement = registry->createPlasmaWindowManagement(registry->interface(Registry::Interface::PlasmaWindowManagement).name,
|
s_waylandConnection.windowManagement = registry->createPlasmaWindowManagement(registry->interface(KWayland::Client::Registry::Interface::PlasmaWindowManagement).name,
|
||||||
registry->interface(Registry::Interface::PlasmaWindowManagement).version);
|
registry->interface(KWayland::Client::Registry::Interface::PlasmaWindowManagement).version);
|
||||||
if (!s_waylandConnection.windowManagement->isValid()) {
|
if (!s_waylandConnection.windowManagement->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::PointerConstraints)) {
|
if (flags.testFlag(AdditionalWaylandInterface::PointerConstraints)) {
|
||||||
s_waylandConnection.pointerConstraints = registry->createPointerConstraints(registry->interface(Registry::Interface::PointerConstraintsUnstableV1).name,
|
s_waylandConnection.pointerConstraints = registry->createPointerConstraints(registry->interface(KWayland::Client::Registry::Interface::PointerConstraintsUnstableV1).name,
|
||||||
registry->interface(Registry::Interface::PointerConstraintsUnstableV1).version);
|
registry->interface(KWayland::Client::Registry::Interface::PointerConstraintsUnstableV1).version);
|
||||||
if (!s_waylandConnection.pointerConstraints->isValid()) {
|
if (!s_waylandConnection.pointerConstraints->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::AppMenu)) {
|
if (flags.testFlag(AdditionalWaylandInterface::AppMenu)) {
|
||||||
s_waylandConnection.appMenu = registry->createAppMenuManager(registry->interface(Registry::Interface::AppMenu).name, registry->interface(Registry::Interface::AppMenu).version);
|
s_waylandConnection.appMenu = registry->createAppMenuManager(registry->interface(KWayland::Client::Registry::Interface::AppMenu).name, registry->interface(KWayland::Client::Registry::Interface::AppMenu).version);
|
||||||
if (!s_waylandConnection.appMenu->isValid()) {
|
if (!s_waylandConnection.appMenu->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags.testFlag(AdditionalWaylandInterface::TextInputManagerV2)) {
|
if (flags.testFlag(AdditionalWaylandInterface::TextInputManagerV2)) {
|
||||||
s_waylandConnection.textInputManager = registry->createTextInputManager(registry->interface(Registry::Interface::TextInputManagerUnstableV2).name, registry->interface(Registry::Interface::TextInputManagerUnstableV2).version);
|
s_waylandConnection.textInputManager = registry->createTextInputManager(registry->interface(KWayland::Client::Registry::Interface::TextInputManagerUnstableV2).name, registry->interface(KWayland::Client::Registry::Interface::TextInputManagerUnstableV2).version);
|
||||||
if (!s_waylandConnection.textInputManager->isValid()) {
|
if (!s_waylandConnection.textInputManager->isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -557,7 +555,7 @@ void destroyWaylandConnection()
|
||||||
s_waylandConnection.outputDevicesV2.clear();
|
s_waylandConnection.outputDevicesV2.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConnectionThread *waylandConnection()
|
KWayland::Client::ConnectionThread *waylandConnection()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.connection;
|
return s_waylandConnection.connection;
|
||||||
}
|
}
|
||||||
|
@ -567,47 +565,47 @@ KWayland::Client::Compositor *waylandCompositor()
|
||||||
return s_waylandConnection.compositor;
|
return s_waylandConnection.compositor;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubCompositor *waylandSubCompositor()
|
KWayland::Client::SubCompositor *waylandSubCompositor()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.subCompositor;
|
return s_waylandConnection.subCompositor;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShadowManager *waylandShadowManager()
|
KWayland::Client::ShadowManager *waylandShadowManager()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.shadowManager;
|
return s_waylandConnection.shadowManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShmPool *waylandShmPool()
|
KWayland::Client::ShmPool *waylandShmPool()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.shm;
|
return s_waylandConnection.shm;
|
||||||
}
|
}
|
||||||
|
|
||||||
Seat *waylandSeat()
|
KWayland::Client::Seat *waylandSeat()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.seat;
|
return s_waylandConnection.seat;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerSideDecorationManager *waylandServerSideDecoration()
|
KWayland::Client::ServerSideDecorationManager *waylandServerSideDecoration()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.decoration;
|
return s_waylandConnection.decoration;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaShell *waylandPlasmaShell()
|
KWayland::Client::PlasmaShell *waylandPlasmaShell()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.plasmaShell;
|
return s_waylandConnection.plasmaShell;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaWindowManagement *waylandWindowManagement()
|
KWayland::Client::PlasmaWindowManagement *waylandWindowManagement()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.windowManagement;
|
return s_waylandConnection.windowManagement;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointerConstraints *waylandPointerConstraints()
|
KWayland::Client::PointerConstraints *waylandPointerConstraints()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.pointerConstraints;
|
return s_waylandConnection.pointerConstraints;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppMenuManager *waylandAppMenuManager()
|
KWayland::Client::AppMenuManager *waylandAppMenuManager()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.appMenu;
|
return s_waylandConnection.appMenu;
|
||||||
}
|
}
|
||||||
|
@ -617,7 +615,7 @@ KWin::Test::WaylandOutputManagementV2 *waylandOutputManagementV2()
|
||||||
return s_waylandConnection.outputManagementV2;
|
return s_waylandConnection.outputManagementV2;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextInputManager *waylandTextInputManager()
|
KWayland::Client::TextInputManager *waylandTextInputManager()
|
||||||
{
|
{
|
||||||
return s_waylandConnection.textInputManager;
|
return s_waylandConnection.textInputManager;
|
||||||
}
|
}
|
||||||
|
@ -661,7 +659,7 @@ bool waitForWaylandPointer()
|
||||||
if (!s_waylandConnection.seat) {
|
if (!s_waylandConnection.seat) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QSignalSpy hasPointerSpy(s_waylandConnection.seat, &Seat::hasPointerChanged);
|
QSignalSpy hasPointerSpy(s_waylandConnection.seat, &KWayland::Client::Seat::hasPointerChanged);
|
||||||
if (!hasPointerSpy.isValid()) {
|
if (!hasPointerSpy.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -673,7 +671,7 @@ bool waitForWaylandTouch()
|
||||||
if (!s_waylandConnection.seat) {
|
if (!s_waylandConnection.seat) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QSignalSpy hasTouchSpy(s_waylandConnection.seat, &Seat::hasTouchChanged);
|
QSignalSpy hasTouchSpy(s_waylandConnection.seat, &KWayland::Client::Seat::hasTouchChanged);
|
||||||
if (!hasTouchSpy.isValid()) {
|
if (!hasTouchSpy.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -685,7 +683,7 @@ bool waitForWaylandKeyboard()
|
||||||
if (!s_waylandConnection.seat) {
|
if (!s_waylandConnection.seat) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QSignalSpy hasKeyboardSpy(s_waylandConnection.seat, &Seat::hasKeyboardChanged);
|
QSignalSpy hasKeyboardSpy(s_waylandConnection.seat, &KWayland::Client::Seat::hasKeyboardChanged);
|
||||||
if (!hasKeyboardSpy.isValid()) {
|
if (!hasKeyboardSpy.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -748,7 +746,7 @@ std::unique_ptr<KWayland::Client::Surface> createSurface()
|
||||||
return s->isValid() ? std::move(s) : nullptr;
|
return s->isValid() ? std::move(s) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
SubSurface *createSubSurface(KWayland::Client::Surface *surface, KWayland::Client::Surface *parentSurface, QObject *parent)
|
KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface, KWayland::Client::Surface *parentSurface, QObject *parent)
|
||||||
{
|
{
|
||||||
if (!s_waylandConnection.subCompositor) {
|
if (!s_waylandConnection.subCompositor) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -68,7 +68,6 @@ void TouchInputTest::initTestCase()
|
||||||
|
|
||||||
void TouchInputTest::init()
|
void TouchInputTest::init()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1));
|
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1));
|
||||||
QVERIFY(Test::waitForWaylandTouch());
|
QVERIFY(Test::waitForWaylandTouch());
|
||||||
m_touch = Test::waylandSeat()->createTouch(Test::waylandSeat());
|
m_touch = Test::waylandSeat()->createTouch(Test::waylandSeat());
|
||||||
|
@ -88,7 +87,6 @@ void TouchInputTest::cleanup()
|
||||||
|
|
||||||
std::pair<Window *, std::unique_ptr<KWayland::Client::Surface>> TouchInputTest::showWindow(bool decorated)
|
std::pair<Window *, std::unique_ptr<KWayland::Client::Surface>> TouchInputTest::showWindow(bool decorated)
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
#define VERIFY(statement) \
|
#define VERIFY(statement) \
|
||||||
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
|
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
|
||||||
return {nullptr, nullptr};
|
return {nullptr, nullptr};
|
||||||
|
@ -154,17 +152,16 @@ void TouchInputTest::testMultipleTouchPoints_data()
|
||||||
|
|
||||||
void TouchInputTest::testMultipleTouchPoints()
|
void TouchInputTest::testMultipleTouchPoints()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
QFETCH(bool, decorated);
|
QFETCH(bool, decorated);
|
||||||
auto [window, surface] = showWindow(decorated);
|
auto [window, surface] = showWindow(decorated);
|
||||||
QCOMPARE(window->isDecorated(), decorated);
|
QCOMPARE(window->isDecorated(), decorated);
|
||||||
window->move(QPoint(100, 100));
|
window->move(QPoint(100, 100));
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
|
QSignalSpy sequenceStartedSpy(m_touch, &KWayland::Client::Touch::sequenceStarted);
|
||||||
QSignalSpy pointAddedSpy(m_touch, &Touch::pointAdded);
|
QSignalSpy pointAddedSpy(m_touch, &KWayland::Client::Touch::pointAdded);
|
||||||
QSignalSpy pointMovedSpy(m_touch, &Touch::pointMoved);
|
QSignalSpy pointMovedSpy(m_touch, &KWayland::Client::Touch::pointMoved);
|
||||||
QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved);
|
QSignalSpy pointRemovedSpy(m_touch, &KWayland::Client::Touch::pointRemoved);
|
||||||
QSignalSpy endedSpy(m_touch, &Touch::sequenceEnded);
|
QSignalSpy endedSpy(m_touch, &KWayland::Client::Touch::sequenceEnded);
|
||||||
|
|
||||||
quint32 timestamp = 1;
|
quint32 timestamp = 1;
|
||||||
Test::touchDown(1, QPointF(125, 125) + window->clientPos(), timestamp++);
|
Test::touchDown(1, QPointF(125, 125) + window->clientPos(), timestamp++);
|
||||||
|
@ -211,13 +208,12 @@ void TouchInputTest::testMultipleTouchPoints()
|
||||||
|
|
||||||
void TouchInputTest::testCancel()
|
void TouchInputTest::testCancel()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
auto [window, surface] = showWindow();
|
auto [window, surface] = showWindow();
|
||||||
window->move(QPoint(100, 100));
|
window->move(QPoint(100, 100));
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
|
QSignalSpy sequenceStartedSpy(m_touch, &KWayland::Client::Touch::sequenceStarted);
|
||||||
QSignalSpy cancelSpy(m_touch, &Touch::sequenceCanceled);
|
QSignalSpy cancelSpy(m_touch, &KWayland::Client::Touch::sequenceCanceled);
|
||||||
QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved);
|
QSignalSpy pointRemovedSpy(m_touch, &KWayland::Client::Touch::pointRemoved);
|
||||||
|
|
||||||
quint32 timestamp = 1;
|
quint32 timestamp = 1;
|
||||||
Test::touchDown(1, QPointF(125, 125), timestamp++);
|
Test::touchDown(1, QPointF(125, 125), timestamp++);
|
||||||
|
@ -233,7 +229,7 @@ void TouchInputTest::testCancel()
|
||||||
void TouchInputTest::testTouchMouseAction()
|
void TouchInputTest::testTouchMouseAction()
|
||||||
{
|
{
|
||||||
// this test verifies that a touch down on an inactive window will activate it
|
// this test verifies that a touch down on an inactive window will activate it
|
||||||
using namespace KWayland::Client;
|
|
||||||
// create two windows
|
// create two windows
|
||||||
auto [c1, surface] = showWindow();
|
auto [c1, surface] = showWindow();
|
||||||
QVERIFY(c1);
|
QVERIFY(c1);
|
||||||
|
@ -244,7 +240,7 @@ void TouchInputTest::testTouchMouseAction()
|
||||||
QVERIFY(c2->isActive());
|
QVERIFY(c2->isActive());
|
||||||
|
|
||||||
// also create a sequence started spy as the touch event should be passed through
|
// also create a sequence started spy as the touch event should be passed through
|
||||||
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
|
QSignalSpy sequenceStartedSpy(m_touch, &KWayland::Client::Touch::sequenceStarted);
|
||||||
|
|
||||||
quint32 timestamp = 1;
|
quint32 timestamp = 1;
|
||||||
Test::touchDown(1, c1->frameGeometry().center(), timestamp++);
|
Test::touchDown(1, c1->frameGeometry().center(), timestamp++);
|
||||||
|
|
|
@ -90,8 +90,6 @@ void TransientPlacementTest::cleanup()
|
||||||
|
|
||||||
void TransientPlacementTest::testXdgPopup_data()
|
void TransientPlacementTest::testXdgPopup_data()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
QTest::addColumn<QSize>("parentSize");
|
QTest::addColumn<QSize>("parentSize");
|
||||||
QTest::addColumn<QPoint>("parentPosition");
|
QTest::addColumn<QPoint>("parentPosition");
|
||||||
QTest::addColumn<PopupLayout>("layout");
|
QTest::addColumn<PopupLayout>("layout");
|
||||||
|
@ -407,8 +405,6 @@ void TransientPlacementTest::testXdgPopup_data()
|
||||||
|
|
||||||
void TransientPlacementTest::testXdgPopup()
|
void TransientPlacementTest::testXdgPopup()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
// this test verifies that the position of a transient window is taken from the passed position
|
// this test verifies that the position of a transient window is taken from the passed position
|
||||||
// there are no further constraints like window too large to fit screen, cascading transients, etc
|
// there are no further constraints like window too large to fit screen, cascading transients, etc
|
||||||
// some test cases also verify that the transient fits on the screen
|
// some test cases also verify that the transient fits on the screen
|
||||||
|
@ -462,19 +458,17 @@ void TransientPlacementTest::testXdgPopup()
|
||||||
|
|
||||||
void TransientPlacementTest::testXdgPopupWithPanel()
|
void TransientPlacementTest::testXdgPopupWithPanel()
|
||||||
{
|
{
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
const Output *output = workspace()->activeOutput();
|
const Output *output = workspace()->activeOutput();
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface{Test::createSurface()};
|
std::unique_ptr<KWayland::Client::Surface> surface{Test::createSurface()};
|
||||||
QVERIFY(surface != nullptr);
|
QVERIFY(surface != nullptr);
|
||||||
std::unique_ptr<Test::XdgToplevel> dockShellSurface{Test::createXdgToplevelSurface(surface.get())};
|
std::unique_ptr<Test::XdgToplevel> dockShellSurface{Test::createXdgToplevelSurface(surface.get())};
|
||||||
QVERIFY(dockShellSurface != nullptr);
|
QVERIFY(dockShellSurface != nullptr);
|
||||||
std::unique_ptr<PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get()));
|
std::unique_ptr<KWayland::Client::PlasmaShellSurface> plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get()));
|
||||||
QVERIFY(plasmaSurface != nullptr);
|
QVERIFY(plasmaSurface != nullptr);
|
||||||
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
|
plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel);
|
||||||
plasmaSurface->setPosition(QPoint(0, output->geometry().height() - 50));
|
plasmaSurface->setPosition(QPoint(0, output->geometry().height() - 50));
|
||||||
plasmaSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible);
|
plasmaSurface->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::AlwaysVisible);
|
||||||
|
|
||||||
// now render and map the window
|
// now render and map the window
|
||||||
auto dock = Test::renderAndWaitForShown(surface.get(), QSize(1280, 50), Qt::blue);
|
auto dock = Test::renderAndWaitForShown(surface.get(), QSize(1280, 50), Qt::blue);
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include <KWayland/Client/surface.h>
|
#include <KWayland/Client/surface.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_virtualdesktop-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_virtualdesktop-0");
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_window_selection-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_window_selection-0");
|
||||||
|
|
||||||
|
@ -87,12 +86,12 @@ void TestWindowSelection::testSelectOnWindowPointer()
|
||||||
// this test verifies window selection through pointer works
|
// this test verifies window selection through pointer works
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
||||||
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
|
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -169,12 +168,12 @@ void TestWindowSelection::testSelectOnWindowKeyboard()
|
||||||
// this test verifies window selection through keyboard key
|
// this test verifies window selection through keyboard key
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
||||||
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
|
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -235,9 +234,9 @@ void TestWindowSelection::testSelectOnWindowKeyboard()
|
||||||
void TestWindowSelection::testSelectOnWindowTouch()
|
void TestWindowSelection::testSelectOnWindowTouch()
|
||||||
{
|
{
|
||||||
// this test verifies window selection through touch
|
// this test verifies window selection through touch
|
||||||
std::unique_ptr<Touch> touch(Test::waylandSeat()->createTouch());
|
std::unique_ptr<KWayland::Client::Touch> touch(Test::waylandSeat()->createTouch());
|
||||||
QSignalSpy touchStartedSpy(touch.get(), &Touch::sequenceStarted);
|
QSignalSpy touchStartedSpy(touch.get(), &KWayland::Client::Touch::sequenceStarted);
|
||||||
QSignalSpy touchCanceledSpy(touch.get(), &Touch::sequenceCanceled);
|
QSignalSpy touchCanceledSpy(touch.get(), &KWayland::Client::Touch::sequenceCanceled);
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
|
@ -298,12 +297,12 @@ void TestWindowSelection::testCancelOnWindowPointer()
|
||||||
// this test verifies that window selection cancels through right button click
|
// this test verifies that window selection cancels through right button click
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
||||||
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
|
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -353,12 +352,12 @@ void TestWindowSelection::testCancelOnWindowKeyboard()
|
||||||
// this test verifies that cancel window selection through escape key works
|
// this test verifies that cancel window selection through escape key works
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
||||||
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
|
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
@ -408,12 +407,12 @@ void TestWindowSelection::testSelectPointPointer()
|
||||||
// this test verifies point selection through pointer works
|
// this test verifies point selection through pointer works
|
||||||
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
|
std::unique_ptr<KWayland::Client::Pointer> pointer(Test::waylandSeat()->createPointer());
|
||||||
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
std::unique_ptr<KWayland::Client::Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
|
||||||
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
|
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
|
||||||
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
|
QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left);
|
||||||
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
|
QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered);
|
||||||
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
|
QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left);
|
||||||
|
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <xcb/xcb_icccm.h>
|
#include <xcb/xcb_icccm.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_x11_window-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_x11_window-0");
|
||||||
|
|
||||||
class X11WindowTest : public QObject
|
class X11WindowTest : public QObject
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow_rules-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow_rules-0");
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
using namespace KWin;
|
using namespace KWin;
|
||||||
using namespace KWayland::Client;
|
|
||||||
|
|
||||||
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow-0");
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow-0");
|
||||||
|
|
||||||
|
@ -227,7 +226,7 @@ void TestXdgShellWindow::testMapUnmap()
|
||||||
QCOMPARE(configureRequestedSpy.count(), 2);
|
QCOMPARE(configureRequestedSpy.count(), 2);
|
||||||
|
|
||||||
// Unmap the xdg_toplevel surface by committing a null buffer.
|
// Unmap the xdg_toplevel surface by committing a null buffer.
|
||||||
surface->attachBuffer(Buffer::Ptr());
|
surface->attachBuffer(KWayland::Client::Buffer::Ptr());
|
||||||
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
||||||
QVERIFY(Test::waitForWindowDestroyed(window));
|
QVERIFY(Test::waitForWindowDestroyed(window));
|
||||||
|
|
||||||
|
@ -853,7 +852,7 @@ void TestXdgShellWindow::testAppMenu()
|
||||||
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
||||||
QVERIFY(window);
|
QVERIFY(window);
|
||||||
std::unique_ptr<AppMenu> menu(Test::waylandAppMenuManager()->create(surface.get()));
|
std::unique_ptr<KWayland::Client::AppMenu> menu(Test::waylandAppMenuManager()->create(surface.get()));
|
||||||
QSignalSpy spy(window, &Window::hasApplicationMenuChanged);
|
QSignalSpy spy(window, &Window::hasApplicationMenuChanged);
|
||||||
menu->setAddress("service.name", "object/path");
|
menu->setAddress("service.name", "object/path");
|
||||||
spy.wait();
|
spy.wait();
|
||||||
|
@ -1116,7 +1115,7 @@ void TestXdgShellWindow::testXdgWindowGeometryIsntSet()
|
||||||
QCOMPARE(window->bufferGeometry().size(), QSize(100, 50));
|
QCOMPARE(window->bufferGeometry().size(), QSize(100, 50));
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> childSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> childSurface(Test::createSurface());
|
||||||
std::unique_ptr<SubSurface> subSurface(Test::createSubSurface(childSurface.get(), surface.get()));
|
std::unique_ptr<KWayland::Client::SubSurface> subSurface(Test::createSubSurface(childSurface.get(), surface.get()));
|
||||||
QVERIFY(subSurface);
|
QVERIFY(subSurface);
|
||||||
subSurface->setPosition(QPoint(-20, -10));
|
subSurface->setPosition(QPoint(-20, -10));
|
||||||
Test::render(childSurface.get(), QSize(100, 50), Qt::blue);
|
Test::render(childSurface.get(), QSize(100, 50), Qt::blue);
|
||||||
|
@ -1200,7 +1199,7 @@ void TestXdgShellWindow::testXdgWindowGeometryAttachSubSurface()
|
||||||
QCOMPARE(window->bufferGeometry().size(), QSize(200, 100));
|
QCOMPARE(window->bufferGeometry().size(), QSize(200, 100));
|
||||||
|
|
||||||
std::unique_ptr<KWayland::Client::Surface> childSurface(Test::createSurface());
|
std::unique_ptr<KWayland::Client::Surface> childSurface(Test::createSurface());
|
||||||
std::unique_ptr<SubSurface> subSurface(Test::createSubSurface(childSurface.get(), surface.get()));
|
std::unique_ptr<KWayland::Client::SubSurface> subSurface(Test::createSubSurface(childSurface.get(), surface.get()));
|
||||||
QVERIFY(subSurface);
|
QVERIFY(subSurface);
|
||||||
subSurface->setPosition(QPoint(-20, -20));
|
subSurface->setPosition(QPoint(-20, -20));
|
||||||
Test::render(childSurface.get(), QSize(100, 50), Qt::blue);
|
Test::render(childSurface.get(), QSize(100, 50), Qt::blue);
|
||||||
|
|
Loading…
Reference in a new issue