From 482741499d4588c2025392e0fb77ba426ed0b3d3 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 7 Nov 2022 23:33:00 +0200 Subject: [PATCH] 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. --- autotests/integration/activation_test.cpp | 12 -- .../integration/buffer_size_change_test.cpp | 6 +- autotests/integration/dbus_interface_test.cpp | 1 - autotests/integration/debug_console_test.cpp | 3 +- .../integration/decoration_input_test.cpp | 2 - .../dont_crash_cancel_animation.cpp | 1 - .../dont_crash_reinitialize_compositor.cpp | 2 - .../dont_crash_useractions_menu.cpp | 1 - .../desktop_switching_animation_test.cpp | 1 - .../effects/maximize_animation_test.cpp | 2 - .../effects/minimize_animation_test.cpp | 12 +- .../popup_open_close_animation_test.cpp | 3 - .../effects/scripted_effects_test.cpp | 10 -- .../effects/slidingpopups_test.cpp | 13 +-- .../toplevel_open_close_animation_test.cpp | 2 - .../integration/globalshortcuts_test.cpp | 1 - .../integration/idle_inhibition_test.cpp | 3 +- .../integration/input_stacking_order.cpp | 7 +- autotests/integration/inputmethod_test.cpp | 43 ++++---- autotests/integration/internal_window.cpp | 8 +- .../integration/keyboard_layout_test.cpp | 3 - .../keymap_creation_failure_test.cpp | 1 - autotests/integration/kwinbindings_test.cpp | 1 - autotests/integration/lockscreen.cpp | 54 ++++----- autotests/integration/maximize_test.cpp | 1 - .../modifier_only_shortcut_test.cpp | 1 - .../integration/move_resize_window_test.cpp | 38 ++----- .../integration/no_global_shortcuts_test.cpp | 1 - autotests/integration/plasmawindow_test.cpp | 20 ++-- .../integration/pointer_constraints_test.cpp | 39 ++++--- autotests/integration/pointer_input.cpp | 88 +++++++-------- autotests/integration/quick_tiling_test.cpp | 15 +-- autotests/integration/screen_changes_test.cpp | 19 ++-- .../scripting/minimizeall_test.cpp | 2 - .../integration/showing_desktop_test.cpp | 5 +- autotests/integration/struts_test.cpp | 20 ++-- autotests/integration/tabbox_test.cpp | 1 - autotests/integration/test_helpers.cpp | 104 +++++++++--------- autotests/integration/touch_input_test.cpp | 24 ++-- autotests/integration/transient_placement.cpp | 12 +- .../integration/virtual_desktop_test.cpp | 1 - .../integration/window_selection_test.cpp | 67 ++++++----- autotests/integration/x11_window_test.cpp | 1 - .../integration/xdgshellwindow_rules_test.cpp | 1 - autotests/integration/xdgshellwindow_test.cpp | 9 +- 45 files changed, 256 insertions(+), 405 deletions(-) diff --git a/autotests/integration/activation_test.cpp b/autotests/integration/activation_test.cpp index 77c4d89f29..f43df92bdb 100644 --- a/autotests/integration/activation_test.cpp +++ b/autotests/integration/activation_test.cpp @@ -80,8 +80,6 @@ void ActivationTest::testSwitchToWindowToLeft() { // This test verifies that "Switch to Window to the Left" shortcut works. - using namespace KWayland::Client; - // Prepare the test environment. stackScreensHorizontally(); @@ -148,8 +146,6 @@ void ActivationTest::testSwitchToWindowToRight() { // This test verifies that "Switch to Window to the Right" shortcut works. - using namespace KWayland::Client; - // Prepare the test environment. stackScreensHorizontally(); @@ -216,8 +212,6 @@ void ActivationTest::testSwitchToWindowAbove() { // This test verifies that "Switch to Window Above" shortcut works. - using namespace KWayland::Client; - // Prepare the test environment. stackScreensVertically(); @@ -284,8 +278,6 @@ void ActivationTest::testSwitchToWindowBelow() { // This test verifies that "Switch to Window Bottom" shortcut works. - using namespace KWayland::Client; - // Prepare the test environment. stackScreensVertically(); @@ -353,8 +345,6 @@ void ActivationTest::testSwitchToWindowMaximized() // 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. - using namespace KWayland::Client; - // Prepare the test environment. stackScreensHorizontally(); @@ -438,8 +428,6 @@ void ActivationTest::testSwitchToWindowFullScreen() // 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. - using namespace KWayland::Client; - // Prepare the test environment. stackScreensVertically(); diff --git a/autotests/integration/buffer_size_change_test.cpp b/autotests/integration/buffer_size_change_test.cpp index b3454f2090..e3683e06ec 100644 --- a/autotests/integration/buffer_size_change_test.cpp +++ b/autotests/integration/buffer_size_change_test.cpp @@ -44,8 +44,6 @@ void BufferSizeChangeTest::testShmBufferSizeChange() { // This test verifies that an SHM buffer size change is handled correctly - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -72,8 +70,6 @@ void BufferSizeChangeTest::testShmBufferSizeChange() void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface() { - using namespace KWayland::Client; - // setup parent surface std::unique_ptr parentSurface(Test::createSurface()); QVERIFY(parentSurface != nullptr); @@ -83,7 +79,7 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface() // setup sub surface std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); - std::unique_ptr subSurface(Test::createSubSurface(surface.get(), parentSurface.get())); + std::unique_ptr subSurface(Test::createSubSurface(surface.get(), parentSurface.get())); QVERIFY(subSurface != nullptr); // set buffer sizes diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index b536b3b98b..e37fbabef4 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -32,7 +32,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_dbus_interface-0"); diff --git a/autotests/integration/debug_console_test.cpp b/autotests/integration/debug_console_test.cpp index 765fe5b558..2a47828fa2 100644 --- a/autotests/integration/debug_console_test.cpp +++ b/autotests/integration/debug_console_test.cpp @@ -302,7 +302,6 @@ void DebugConsoleTest::testWaylandClient() QVERIFY(Test::setupWaylandConnection()); // create the Surface and ShellSurface - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface->isValid()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -361,7 +360,7 @@ void DebugConsoleTest::testWaylandClient() // now close the window again, it should be removed from the model QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved); - surface->attachBuffer(Buffer::Ptr()); + surface->attachBuffer(KWayland::Client::Buffer::Ptr()); surface->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(rowsRemovedSpy.wait()); diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp index 29d4ebdc56..f9b801a50f 100644 --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -82,7 +82,6 @@ private: std::pair> DecorationInputTest::showWindow() { - using namespace KWayland::Client; #define VERIFY(statement) \ if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \ return {nullptr, nullptr}; @@ -146,7 +145,6 @@ void DecorationInputTest::initTestCase() void DecorationInputTest::init() { - using namespace KWayland::Client; QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1)); QVERIFY(Test::waitForWaylandPointer()); diff --git a/autotests/integration/dont_crash_cancel_animation.cpp b/autotests/integration/dont_crash_cancel_animation.cpp index f7f4003e52..94a0320b6c 100644 --- a/autotests/integration/dont_crash_cancel_animation.cpp +++ b/autotests/integration/dont_crash_cancel_animation.cpp @@ -80,7 +80,6 @@ void DontCrashCancelAnimationFromAnimationEndedTest::testScript() } QVERIFY(static_cast(effects)->isEffectLoaded(QStringLiteral("crashy"))); - using namespace KWayland::Client; // create a window std::unique_ptr surface{Test::createSurface()}; QVERIFY(surface); diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp index c5e0cdc744..5643ef1ec2 100644 --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -109,8 +109,6 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor() QVERIFY(effectsImpl); // Create the test window. - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); diff --git a/autotests/integration/dont_crash_useractions_menu.cpp b/autotests/integration/dont_crash_useractions_menu.cpp index eb26315b9f..0c2e5c8931 100644 --- a/autotests/integration/dont_crash_useractions_menu.cpp +++ b/autotests/integration/dont_crash_useractions_menu.cpp @@ -29,7 +29,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_dont_crash_useractions_menu-0"); diff --git a/autotests/integration/effects/desktop_switching_animation_test.cpp b/autotests/integration/effects/desktop_switching_animation_test.cpp index bc96e43be9..08a0f85f87 100644 --- a/autotests/integration/effects/desktop_switching_animation_test.cpp +++ b/autotests/integration/effects/desktop_switching_animation_test.cpp @@ -103,7 +103,6 @@ void DesktopSwitchingAnimationTest::testSwitchDesktops() // The Fade Desktop effect will do nothing if there are no windows to fade, // so we have to create a dummy test window. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); diff --git a/autotests/integration/effects/maximize_animation_test.cpp b/autotests/integration/effects/maximize_animation_test.cpp index d1b0e53963..df2f186585 100644 --- a/autotests/integration/effects/maximize_animation_test.cpp +++ b/autotests/integration/effects/maximize_animation_test.cpp @@ -82,8 +82,6 @@ void MaximizeAnimationTest::testMaximizeRestore() // This test verifies that the maximize effect animates a window // when it's maximized or restored. - using namespace KWayland::Client; - // Create the test window. std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); diff --git a/autotests/integration/effects/minimize_animation_test.cpp b/autotests/integration/effects/minimize_animation_test.cpp index a11553aea9..0ef796e0d6 100644 --- a/autotests/integration/effects/minimize_animation_test.cpp +++ b/autotests/integration/effects/minimize_animation_test.cpp @@ -96,9 +96,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize() // This test verifies that a minimize effect tries to animate a window // when it's minimized or unminimized. - using namespace KWayland::Client; - - QSignalSpy plasmaWindowCreatedSpy(Test::waylandWindowManagement(), &PlasmaWindowManagement::windowCreated); + QSignalSpy plasmaWindowCreatedSpy(Test::waylandWindowManagement(), &KWayland::Client::PlasmaWindowManagement::windowCreated); // Create a panel at the top of the screen. const QRect panelRect = QRect(0, 0, 1280, 36); @@ -106,11 +104,11 @@ void MinimizeAnimationTest::testMinimizeUnminimize() QVERIFY(panelSurface != nullptr); std::unique_ptr panelShellSurface(Test::createXdgToplevelSurface(panelSurface.get())); QVERIFY(panelShellSurface != nullptr); - std::unique_ptr plasmaPanelShellSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get())); + std::unique_ptr plasmaPanelShellSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get())); QVERIFY(plasmaPanelShellSurface != nullptr); - plasmaPanelShellSurface->setRole(PlasmaShellSurface::Role::Panel); + plasmaPanelShellSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); 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); QVERIFY(panel); QVERIFY(panel->isDock()); @@ -130,7 +128,7 @@ void MinimizeAnimationTest::testMinimizeUnminimize() // We have to set the minimized geometry because the squash effect needs it, // otherwise it won't start animation. - auto plasmaWindow = plasmaWindowCreatedSpy.last().first().value(); + auto plasmaWindow = plasmaWindowCreatedSpy.last().first().value(); QVERIFY(plasmaWindow); const QRect iconRect = QRect(0, 0, 42, 36); plasmaWindow->setMinimizedGeometry(panelSurface.get(), iconRect); diff --git a/autotests/integration/effects/popup_open_close_animation_test.cpp b/autotests/integration/effects/popup_open_close_animation_test.cpp index 73ad245f98..a4b7c8005b 100644 --- a/autotests/integration/effects/popup_open_close_animation_test.cpp +++ b/autotests/integration/effects/popup_open_close_animation_test.cpp @@ -95,7 +95,6 @@ void PopupOpenCloseAnimationTest::testAnimatePopups() QVERIFY(effectsImpl); // Create the main window. - using namespace KWayland::Client; std::unique_ptr mainWindowSurface(Test::createSurface()); QVERIFY(mainWindowSurface != nullptr); std::unique_ptr mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.get())); @@ -156,7 +155,6 @@ void PopupOpenCloseAnimationTest::testAnimateUserActionsPopup() QVERIFY(effectsImpl); // Create the test window. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -208,7 +206,6 @@ void PopupOpenCloseAnimationTest::testAnimateDecorationTooltips() QVERIFY(effectsImpl); // Create the test window. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly)); diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp index e1b9d0a030..502082439f 100644 --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -187,7 +187,6 @@ void ScriptedEffectsTest::testEffectsHandler() // trigger windowAdded signal // create a window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -266,7 +265,6 @@ void ScriptedEffectsTest::testAnimations() QVERIFY(effect->load(file)); // animated after window added connect - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -373,7 +371,6 @@ void ScriptedEffectsTest::testFullScreenEffect() QVERIFY(effectOther->load("screenEdgeTouchTest")); QSignalSpy isActiveFullScreenEffectSpyOther(effectOther, &ScriptedEffect::isActiveFullScreenEffectChanged); - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -436,7 +433,6 @@ void ScriptedEffectsTest::testKeepAlive() QVERIFY(effect->load(file)); // create a window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); auto *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -480,7 +476,6 @@ void ScriptedEffectsTest::testGrab() QVERIFY(effect->load(QStringLiteral("grabTest"))); // create test window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -511,7 +506,6 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindow() QVERIFY(grabber->load(QStringLiteral("grabAlreadyGrabbedWindowTest_grabber"))); // create test window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -546,7 +540,6 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindowForced() QVERIFY(thief->load(QStringLiteral("grabAlreadyGrabbedWindowForcedTest_thief"))); // create test window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -576,7 +569,6 @@ void ScriptedEffectsTest::testUngrab() QVERIFY(effect->load(QStringLiteral("ungrabTest"))); // create test window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -619,7 +611,6 @@ void ScriptedEffectsTest::testRedirect() QVERIFY(effect->load(file)); // create test window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); @@ -696,7 +687,6 @@ void ScriptedEffectsTest::testComplete() QVERIFY(effect->load(QStringLiteral("completeTest"))); // create test window - using namespace KWayland::Client; std::unique_ptr surface = Test::createSurface(); QVERIFY(surface); Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get()); diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp index 1e9a729095..b30532ec9f 100644 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -291,24 +291,23 @@ void SlidingPopupsTest::testWithOtherEffectWayland() QVERIFY(!otherEffect->isActive()); QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded); - using namespace KWayland::Client; // the test created the slide protocol, let's create a Registry and listen for it - std::unique_ptr registry(new Registry); + std::unique_ptr registry(new KWayland::Client::Registry); registry->create(Test::waylandConnection()); - QSignalSpy interfacesAnnouncedSpy(registry.get(), &Registry::interfacesAnnounced); + QSignalSpy interfacesAnnouncedSpy(registry.get(), &KWayland::Client::Registry::interfacesAnnounced); registry->setup(); QVERIFY(interfacesAnnouncedSpy.wait()); - auto slideInterface = registry->interface(Registry::Interface::Slide); + auto slideInterface = registry->interface(KWayland::Client::Registry::Interface::Slide); QVERIFY(slideInterface.name != 0); - std::unique_ptr slideManager(registry->createSlideManager(slideInterface.name, slideInterface.version)); + std::unique_ptr slideManager(registry->createSlideManager(slideInterface.name, slideInterface.version)); QVERIFY(slideManager); // create Wayland window std::unique_ptr surface(Test::createSurface()); QVERIFY(surface); - std::unique_ptr slide(slideManager->createSlide(surface.get())); - slide->setLocation(Slide::Location::Left); + std::unique_ptr slide(slideManager->createSlide(surface.get())); + slide->setLocation(KWayland::Client::Slide::Location::Left); slide->commit(); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); QVERIFY(shellSurface); diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp index c7d35bd3f4..1fa6685cf5 100644 --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -112,7 +112,6 @@ void ToplevelOpenCloseAnimationTest::testAnimateToplevels() QVERIFY(!effect->isActive()); // Create the test window. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -155,7 +154,6 @@ void ToplevelOpenCloseAnimationTest::testDontAnimatePopups() QVERIFY(effectsImpl); // Create the main window. - using namespace KWayland::Client; std::unique_ptr mainWindowSurface(Test::createSurface()); QVERIFY(mainWindowSurface != nullptr); std::unique_ptr mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.get())); diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp index f22094fa64..cf5f013edc 100644 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -32,7 +32,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_globalshortcuts-0"); diff --git a/autotests/integration/idle_inhibition_test.cpp b/autotests/integration/idle_inhibition_test.cpp index 750ba01300..c21492e171 100644 --- a/autotests/integration/idle_inhibition_test.cpp +++ b/autotests/integration/idle_inhibition_test.cpp @@ -17,7 +17,6 @@ #include using namespace KWin; -using namespace KWayland::Client; 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}); // Unmap the window. - surface->attachBuffer(Buffer::Ptr()); + surface->attachBuffer(KWayland::Client::Buffer::Ptr()); surface->commit(KWayland::Client::Surface::CommitFlag::None); QVERIFY(Test::waitForWindowDestroyed(window)); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp index 6b16438b72..7b5e31f0fd 100644 --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -65,7 +65,6 @@ void InputStackingOrderTest::initTestCase() void InputStackingOrderTest::init() { - using namespace KWayland::Client; QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat)); 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 // 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 - using namespace KWayland::Client; + // create pointer and signal spy for enter and leave signals auto pointer = Test::waylandSeat()->createPointer(Test::waylandSeat()); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); // now create the two windows and make them overlap QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index 0f2c8456ea..73f157bc9b 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -43,7 +43,6 @@ #include using namespace KWin; -using namespace KWayland::Client; using KWin::VirtualKeyboardDBus; 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); QVERIFY(surfaceConfigureRequestedSpy.wait()); - std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); + std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); QVERIFY(textInput != nullptr); // Show the keyboard @@ -242,7 +241,7 @@ void InputMethodTest::testEnableActive() // Show the keyboard QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); - std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); + std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); textInput->enable(surface.get()); QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged); QVERIFY(paneladded.wait()); @@ -272,7 +271,7 @@ void InputMethodTest::testHidePanel() QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved); QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged); - std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); + std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); // Create an xdg_toplevel surface and wait for the compositor to catch up. std::unique_ptr surface(Test::createSurface()); @@ -315,7 +314,7 @@ void InputMethodTest::testSwitchFocusedSurfaces() QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved); QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged); - std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); + std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); QVector windows; std::vector> surfaces; @@ -363,7 +362,7 @@ void InputMethodTest::testV2V3SameClient() QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved); QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged); - std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); + std::unique_ptr textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat())); auto textInputV3 = std::make_unique(); textInputV3->init(Test::waylandTextInputManagerV3()->get_text_input(*(Test::waylandSeat()))); @@ -572,21 +571,21 @@ void InputMethodTest::testModifierForwarding() auto context = Test::inputMethod()->context(); std::unique_ptr keyboardGrab(new KWayland::Client::Keyboard); 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 QVERIFY(modifierSpy.wait()); quint32 timestamp = 1; - QSignalSpy keySpy(keyboardGrab.get(), &Keyboard::keyChanged); + QSignalSpy keySpy(keyboardGrab.get(), &KWayland::Client::Keyboard::keyChanged); bool keyChanged = false; bool modifiersChanged = false; // 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); keyChanged = true; }); - auto modifiersChangedConnection = connect(keyboardGrab.get(), &Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() { + auto modifiersChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() { QVERIFY(keyChanged); modifiersChanged = true; }); @@ -603,11 +602,11 @@ void InputMethodTest::testModifierForwarding() // verify the order of key and modifiers again. Key first, then modifiers. keyChanged = false; modifiersChanged = false; - keyChangedConnection = connect(keyboardGrab.get(), &Keyboard::keyChanged, [&keyChanged, &modifiersChanged]() { + keyChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::keyChanged, [&keyChanged, &modifiersChanged]() { QVERIFY(!modifiersChanged); keyChanged = true; }); - modifiersChangedConnection = connect(keyboardGrab.get(), &Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() { + modifiersChangedConnection = connect(keyboardGrab.get(), &KWayland::Client::Keyboard::modifiersChanged, [&keyChanged, &modifiersChanged]() { QVERIFY(keyChanged); modifiersChanged = true; }); @@ -650,15 +649,15 @@ void InputMethodTest::testFakeEventFallback() keySpy.wait(); QVERIFY(keySpy.count() == 2); - auto compare = [](const QList &input, quint32 key, Keyboard::KeyState state) { + auto compare = [](const QList &input, quint32 key, KWayland::Client::Keyboard::KeyState state) { auto inputKey = input.at(0).toInt(); - auto inputState = input.at(1).value(); + auto inputState = input.at(1).value(); QCOMPARE(inputKey, key); QCOMPARE(inputState, state); }; - compare(keySpy.at(0), KEY_A, Keyboard::KeyState::Pressed); - compare(keySpy.at(1), KEY_A, Keyboard::KeyState::Released); + compare(keySpy.at(0), KEY_A, KWayland::Client::Keyboard::KeyState::Pressed); + compare(keySpy.at(1), KEY_A, KWayland::Client::Keyboard::KeyState::Released); keySpy.clear(); @@ -670,10 +669,10 @@ void InputMethodTest::testFakeEventFallback() keySpy.wait(); QVERIFY(keySpy.count() == 4); - compare(keySpy.at(0), KEY_LEFTSHIFT, Keyboard::KeyState::Pressed); - compare(keySpy.at(1), KEY_A, Keyboard::KeyState::Pressed); - compare(keySpy.at(2), KEY_A, Keyboard::KeyState::Released); - compare(keySpy.at(3), KEY_LEFTSHIFT, Keyboard::KeyState::Released); + compare(keySpy.at(0), KEY_LEFTSHIFT, KWayland::Client::Keyboard::KeyState::Pressed); + compare(keySpy.at(1), KEY_A, KWayland::Client::Keyboard::KeyState::Pressed); + compare(keySpy.at(2), KEY_A, KWayland::Client::Keyboard::KeyState::Released); + compare(keySpy.at(3), KEY_LEFTSHIFT, KWayland::Client::Keyboard::KeyState::Released); keySpy.clear(); @@ -685,8 +684,8 @@ void InputMethodTest::testFakeEventFallback() keySpy.wait(); QVERIFY(keySpy.count() == 2); - compare(keySpy.at(0), KEY_ENTER, Keyboard::KeyState::Pressed); - compare(keySpy.at(1), KEY_ENTER, Keyboard::KeyState::Released); + compare(keySpy.at(0), KEY_ENTER, KWayland::Client::Keyboard::KeyState::Pressed); + compare(keySpy.at(1), KEY_ENTER, KWayland::Client::Keyboard::KeyState::Released); } WAYLANDTEST_MAIN(InputMethodTest) diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index 509c1b7f17..5a3ecd3029 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -28,8 +28,6 @@ #include -using namespace KWayland::Client; - Q_DECLARE_METATYPE(NET::WindowType); 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 // gets a key event - std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); + std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); QVERIFY(keyboard != nullptr); QVERIFY(keyboard->isValid()); - QSignalSpy enteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy leftSpy(keyboard.get(), &Keyboard::left); + QSignalSpy enteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy leftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); diff --git a/autotests/integration/keyboard_layout_test.cpp b/autotests/integration/keyboard_layout_test.cpp index c53d931978..b0a61708b4 100644 --- a/autotests/integration/keyboard_layout_test.cpp +++ b/autotests/integration/keyboard_layout_test.cpp @@ -31,7 +31,6 @@ #include using namespace KWin; -using namespace KWayland::Client; 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)")); // create a window - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); auto c1 = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue); @@ -461,7 +459,6 @@ void KeyboardLayoutTest::testApplicationPolicy() QCOMPARE(xkb->layoutName(), QStringLiteral("English (US)")); // create a window - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); shellSurface->set_app_id(QStringLiteral("org.kde.foo")); diff --git a/autotests/integration/keymap_creation_failure_test.cpp b/autotests/integration/keymap_creation_failure_test.cpp index cee35e505c..84b593b421 100644 --- a/autotests/integration/keymap_creation_failure_test.cpp +++ b/autotests/integration/keymap_creation_failure_test.cpp @@ -22,7 +22,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_keymap_creation_failure-0"); diff --git a/autotests/integration/kwinbindings_test.cpp b/autotests/integration/kwinbindings_test.cpp index 58c9a0f6d9..b46fab4afb 100644 --- a/autotests/integration/kwinbindings_test.cpp +++ b/autotests/integration/kwinbindings_test.cpp @@ -25,7 +25,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_kwinbindings-0"); diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp index d128746b57..46ba156252 100644 --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -149,7 +149,6 @@ void LockScreenTest::unlock() std::pair> LockScreenTest::showWindow() { - using namespace KWayland::Client; #define VERIFY(statement) \ if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \ return {nullptr, nullptr}; @@ -232,12 +231,10 @@ void LockScreenTest::testStackingOrder() void LockScreenTest::testPointer() { - using namespace KWayland::Client; - - std::unique_ptr pointer(m_seat->createPointer()); + std::unique_ptr pointer(m_seat->createPointer()); QVERIFY(pointer != nullptr); - QSignalSpy enteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy leftSpy(pointer.get(), &Pointer::left); + QSignalSpy enteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer.get(), &KWayland::Client::Pointer::left); auto [window, surface] = showWindow(); QVERIFY(window); @@ -277,12 +274,10 @@ void LockScreenTest::testPointer() void LockScreenTest::testPointerButton() { - using namespace KWayland::Client; - - std::unique_ptr pointer(m_seat->createPointer()); + std::unique_ptr pointer(m_seat->createPointer()); QVERIFY(pointer != nullptr); - QSignalSpy enteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy buttonChangedSpy(pointer.get(), &Pointer::buttonStateChanged); + QSignalSpy enteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy buttonChangedSpy(pointer.get(), &KWayland::Client::Pointer::buttonStateChanged); auto [window, surface] = showWindow(); QVERIFY(window); @@ -318,12 +313,10 @@ void LockScreenTest::testPointerButton() void LockScreenTest::testPointerAxis() { - using namespace KWayland::Client; - - std::unique_ptr pointer(m_seat->createPointer()); + std::unique_ptr pointer(m_seat->createPointer()); QVERIFY(pointer != nullptr); - QSignalSpy axisChangedSpy(pointer.get(), &Pointer::axisChanged); - QSignalSpy enteredSpy(pointer.get(), &Pointer::entered); + QSignalSpy axisChangedSpy(pointer.get(), &KWayland::Client::Pointer::axisChanged); + QSignalSpy enteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); auto [window, surface] = showWindow(); QVERIFY(window); @@ -358,13 +351,11 @@ void LockScreenTest::testPointerAxis() void LockScreenTest::testKeyboard() { - using namespace KWayland::Client; - - std::unique_ptr keyboard(m_seat->createKeyboard()); + std::unique_ptr keyboard(m_seat->createKeyboard()); QVERIFY(keyboard != nullptr); - QSignalSpy enteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy leftSpy(keyboard.get(), &Keyboard::left); - QSignalSpy keyChangedSpy(keyboard.get(), &Keyboard::keyChanged); + QSignalSpy enteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy leftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); + QSignalSpy keyChangedSpy(keyboard.get(), &KWayland::Client::Keyboard::keyChanged); auto [window, surface] = showWindow(); QVERIFY(window); @@ -376,13 +367,13 @@ void LockScreenTest::testKeyboard() QVERIFY(keyChangedSpy.wait()); QCOMPARE(keyChangedSpy.count(), 1); QCOMPARE(keyChangedSpy.at(0).at(0).value(), quint32(KEY_A)); - QCOMPARE(keyChangedSpy.at(0).at(1).value(), Keyboard::KeyState::Pressed); + QCOMPARE(keyChangedSpy.at(0).at(1).value(), KWayland::Client::Keyboard::KeyState::Pressed); QCOMPARE(keyChangedSpy.at(0).at(2).value(), quint32(1)); KEYRELEASE(KEY_A); QVERIFY(keyChangedSpy.wait()); QCOMPARE(keyChangedSpy.count(), 2); QCOMPARE(keyChangedSpy.at(1).at(0).value(), quint32(KEY_A)); - QCOMPARE(keyChangedSpy.at(1).at(1).value(), Keyboard::KeyState::Released); + QCOMPARE(keyChangedSpy.at(1).at(1).value(), KWayland::Client::Keyboard::KeyState::Released); QCOMPARE(keyChangedSpy.at(1).at(2).value(), quint32(2)); LOCK; @@ -406,8 +397,8 @@ void LockScreenTest::testKeyboard() QCOMPARE(keyChangedSpy.at(3).at(0).value(), quint32(KEY_C)); QCOMPARE(keyChangedSpy.at(2).at(2).value(), quint32(5)); QCOMPARE(keyChangedSpy.at(3).at(2).value(), quint32(6)); - QCOMPARE(keyChangedSpy.at(2).at(1).value(), Keyboard::KeyState::Pressed); - QCOMPARE(keyChangedSpy.at(3).at(1).value(), Keyboard::KeyState::Released); + QCOMPARE(keyChangedSpy.at(2).at(1).value(), KWayland::Client::Keyboard::KeyState::Pressed); + QCOMPARE(keyChangedSpy.at(3).at(1).value(), KWayland::Client::Keyboard::KeyState::Released); } void LockScreenTest::testScreenEdge() @@ -549,7 +540,6 @@ void LockScreenTest::testEffectsKeyboardAutorepeat() void LockScreenTest::testMoveWindow() { - using namespace KWayland::Client; auto [window, surface] = showWindow(); QVERIFY(window); QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized); @@ -589,7 +579,6 @@ void LockScreenTest::testMoveWindow() void LockScreenTest::testPointerShortcut() { - using namespace KWayland::Client; std::unique_ptr action(new QAction(nullptr)); QSignalSpy actionSpy(action.get(), &QAction::triggered); input()->registerPointerShortcut(Qt::MetaModifier, Qt::LeftButton, action.get()); @@ -633,7 +622,6 @@ void LockScreenTest::testAxisShortcut_data() void LockScreenTest::testAxisShortcut() { - using namespace KWayland::Client; std::unique_ptr action(new QAction(nullptr)); QSignalSpy actionSpy(action.get(), &QAction::triggered); QFETCH(Qt::Orientation, direction); @@ -676,7 +664,6 @@ void LockScreenTest::testAxisShortcut() void LockScreenTest::testKeyboardShortcut() { - using namespace KWayland::Client; std::unique_ptr action(new QAction(nullptr)); QSignalSpy actionSpy(action.get(), &QAction::triggered); action->setProperty("componentName", QStringLiteral("kwin")); @@ -719,15 +706,14 @@ void LockScreenTest::testKeyboardShortcut() void LockScreenTest::testTouch() { - using namespace KWayland::Client; auto touch = m_seat->createTouch(m_seat); QVERIFY(touch); QVERIFY(touch->isValid()); auto [window, surface] = showWindow(); QVERIFY(window); - QSignalSpy sequenceStartedSpy(touch, &Touch::sequenceStarted); - QSignalSpy cancelSpy(touch, &Touch::sequenceCanceled); - QSignalSpy pointRemovedSpy(touch, &Touch::pointRemoved); + QSignalSpy sequenceStartedSpy(touch, &KWayland::Client::Touch::sequenceStarted); + QSignalSpy cancelSpy(touch, &KWayland::Client::Touch::sequenceCanceled); + QSignalSpy pointRemovedSpy(touch, &KWayland::Client::Touch::pointRemoved); quint32 timestamp = 1; Test::touchDown(1, QPointF(25, 25), timestamp++); diff --git a/autotests/integration/maximize_test.cpp b/autotests/integration/maximize_test.cpp index e28f7b60fd..087044352d 100644 --- a/autotests/integration/maximize_test.cpp +++ b/autotests/integration/maximize_test.cpp @@ -27,7 +27,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_maximized-0"); diff --git a/autotests/integration/modifier_only_shortcut_test.cpp b/autotests/integration/modifier_only_shortcut_test.cpp index b3bb4e0ab7..d3807ecdb3 100644 --- a/autotests/integration/modifier_only_shortcut_test.cpp +++ b/autotests/integration/modifier_only_shortcut_test.cpp @@ -25,7 +25,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_modifier_only_shortcut-0"); static const QString s_serviceName = QStringLiteral("org.kde.KWin.Test.ModifierOnlyShortcut"); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index 75c58ed4b3..62169dd5b6 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -109,8 +109,6 @@ void MoveResizeWindowTest::cleanup() void MoveResizeWindowTest::testMove() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -182,7 +180,6 @@ void MoveResizeWindowTest::testMove() void MoveResizeWindowTest::testResize() { // a test case which manually resizes a window - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -316,8 +313,6 @@ void MoveResizeWindowTest::testPackTo_data() void MoveResizeWindowTest::testPackTo() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -354,8 +349,6 @@ void MoveResizeWindowTest::testPackAgainstClient_data() void MoveResizeWindowTest::testPackAgainstClient() { - using namespace KWayland::Client; - std::unique_ptr surface1(Test::createSurface()); QVERIFY(surface1 != nullptr); std::unique_ptr surface2(Test::createSurface()); @@ -421,8 +414,6 @@ void MoveResizeWindowTest::testGrowShrink_data() void MoveResizeWindowTest::testGrowShrink() { - using namespace KWayland::Client; - // block geometry helper std::unique_ptr surface1(Test::createSurface()); QVERIFY(surface1 != nullptr); @@ -481,7 +472,6 @@ void MoveResizeWindowTest::testPointerMoveEnd_data() void MoveResizeWindowTest::testPointerMoveEnd() { // this test verifies that moving a window through pointer only ends if all buttons are released - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -519,12 +509,11 @@ void MoveResizeWindowTest::testPointerMoveEnd() } void MoveResizeWindowTest::testClientSideMove() { - using namespace KWayland::Client; Cursors::self()->mouse()->setPos(640, 512); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left); - QSignalSpy buttonSpy(pointer.get(), &Pointer::buttonStateChanged); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left); + QSignalSpy buttonSpy(pointer.get(), &KWayland::Client::Pointer::buttonStateChanged); std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -578,14 +567,13 @@ void MoveResizeWindowTest::testPlasmaShellSurfaceMovable_data() void MoveResizeWindowTest::testPlasmaShellSurfaceMovable() { // this test verifies that certain window types from PlasmaShellSurface are not moveable or resizable - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); QVERIFY(shellSurface != nullptr); // and a PlasmaShellSurface - std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get())); + std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get())); QVERIFY(plasmaSurface != nullptr); QFETCH(KWayland::Client::PlasmaShellSurface::Role, role); plasmaSurface->setRole(role); @@ -723,7 +711,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel() QVERIFY(panel->isDock()); // let's create a window - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -784,15 +771,14 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel() // see BUG 365892 // first create our panel - using namespace KWayland::Client; std::unique_ptr panelSurface(Test::createSurface()); QVERIFY(panelSurface != nullptr); std::unique_ptr panelShellSurface(Test::createXdgToplevelSurface(panelSurface.get())); QVERIFY(panelShellSurface != nullptr); - std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get())); + std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.get())); QVERIFY(plasmaSurface != nullptr); - plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); - plasmaSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AutoHide); + plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); + plasmaSurface->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::AutoHide); QFETCH(QRect, panelGeometry); plasmaSurface->setPosition(panelGeometry.topLeft()); // let's render @@ -855,8 +841,6 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard_data() void MoveResizeWindowTest::testResizeForVirtualKeyboard() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -930,8 +914,6 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard() void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -980,8 +962,6 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -1033,7 +1013,6 @@ void MoveResizeWindowTest::testDestroyMoveClient() // the associated client is destroyed. // Create the test client. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -1068,7 +1047,6 @@ void MoveResizeWindowTest::testDestroyResizeClient() // the associated client is destroyed. // Create the test client. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); diff --git a/autotests/integration/no_global_shortcuts_test.cpp b/autotests/integration/no_global_shortcuts_test.cpp index bd13044358..291f32fef4 100644 --- a/autotests/integration/no_global_shortcuts_test.cpp +++ b/autotests/integration/no_global_shortcuts_test.cpp @@ -25,7 +25,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_no_global_shortcuts-0"); static const QString s_serviceName = QStringLiteral("org.kde.KWin.Test.ModifierOnlyShortcut"); diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index 2e4db354e2..39b4f4f1af 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -31,8 +31,6 @@ #include #include -using namespace KWayland::Client; - namespace KWin { @@ -52,7 +50,7 @@ private Q_SLOTS: void testDestroyedButNotUnmapped(); private: - PlasmaWindowManagement *m_windowManagement = nullptr; + KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr; KWayland::Client::Compositor *m_compositor = nullptr; }; @@ -92,7 +90,7 @@ void PlasmaWindowTest::cleanup() void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() { // 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 struct XcbConnectionDeleter @@ -142,9 +140,9 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() QCOMPARE(m_windowManagement->windows().count(), 1); auto pw = m_windowManagement->windows().first(); 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); // now shade the window @@ -205,7 +203,7 @@ void HelperWindow::paintEvent(QPaintEvent *event) void PlasmaWindowTest::testInternalWindowNoPlasmaWindow() { // 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; win.setGeometry(0, 0, 100, 100); win.show(); @@ -216,7 +214,7 @@ void PlasmaWindowTest::testInternalWindowNoPlasmaWindow() void PlasmaWindowTest::testPopupWindowNoPlasmaWindow() { // 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 std::unique_ptr parentSurface(Test::createSurface()); @@ -250,7 +248,7 @@ void PlasmaWindowTest::testLockScreenNoPlasmaWindow() { #if KWIN_BUILD_SCREENLOCKER // 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 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 // 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 std::unique_ptr parentSurface(Test::createSurface()); @@ -293,7 +291,7 @@ void PlasmaWindowTest::testDestroyedButNotUnmapped() // this should create a plasma window QVERIFY(plasmaWindowCreatedSpy.wait()); QCOMPARE(plasmaWindowCreatedSpy.count(), 1); - auto window = plasmaWindowCreatedSpy.first().first().value(); + auto window = plasmaWindowCreatedSpy.first().first().value(); QVERIFY(window); QSignalSpy destroyedSpy(window, &QObject::destroyed); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp index 96a04ec11b..c8c4e2fb8a 100644 --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -33,7 +33,6 @@ #include using namespace KWin; -using namespace KWayland::Client; typedef std::function PointerFunc; Q_DECLARE_METATYPE(PointerFunc) @@ -123,10 +122,10 @@ void TestPointerConstraints::testConfinedPointer() // simple interaction test to verify that the pointer gets confined std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr confinedPointer(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot)); - QSignalSpy confinedSpy(confinedPointer.get(), &ConfinedPointer::confined); - QSignalSpy unconfinedSpy(confinedPointer.get(), &ConfinedPointer::unconfined); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr confinedPointer(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::OneShot)); + QSignalSpy confinedSpy(confinedPointer.get(), &KWayland::Client::ConfinedPointer::confined); + QSignalSpy unconfinedSpy(confinedPointer.get(), &KWayland::Client::ConfinedPointer::unconfined); // now map the window auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue); @@ -204,9 +203,9 @@ void TestPointerConstraints::testConfinedPointer() QCOMPARE(input()->pointer()->isConstrained(), false); // reconfine pointer (this time with persistent life time) - confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent)); - QSignalSpy confinedSpy2(confinedPointer.get(), &ConfinedPointer::confined); - QSignalSpy unconfinedSpy2(confinedPointer.get(), &ConfinedPointer::unconfined); + confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::Persistent)); + QSignalSpy confinedSpy2(confinedPointer.get(), &KWayland::Client::ConfinedPointer::confined); + QSignalSpy unconfinedSpy2(confinedPointer.get(), &KWayland::Client::ConfinedPointer::unconfined); // activate it again, this confines again workspace()->activateWindow(static_cast(input()->pointer()->focus())); @@ -256,8 +255,8 @@ void TestPointerConstraints::testConfinedPointer() QCOMPARE(input()->pointer()->isConstrained(), false); // confine again - confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent)); - QSignalSpy confinedSpy3(confinedPointer.get(), &ConfinedPointer::confined); + confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::Persistent)); + QSignalSpy confinedSpy3(confinedPointer.get(), &KWayland::Client::ConfinedPointer::confined); QVERIFY(confinedSpy3.wait()); 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 std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot)); - QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked); - QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::OneShot)); + QSignalSpy lockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::locked); + QSignalSpy unlockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::unlocked); // now map the window 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)); 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)); - QSignalSpy lockedSpy2(lockedPointer.get(), &LockedPointer::locked); + lockedPointer.reset(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::Persistent)); + QSignalSpy lockedSpy2(lockedPointer.get(), &KWayland::Client::LockedPointer::locked); // activate the window again, this should lock again workspace()->activateWindow(static_cast(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 std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot)); - QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked); - QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, KWayland::Client::PointerConstraints::LifeTime::OneShot)); + QSignalSpy lockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::locked); + QSignalSpy unlockedSpy(lockedPointer.get(), &KWayland::Client::LockedPointer::unlocked); // now map the window auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue); diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index 896c0b4489..4b3b3017b0 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -184,13 +184,13 @@ void PointerInputTest::render(KWayland::Client::Surface *surface, const QSize &s void PointerInputTest::testWarpingUpdatesFocus() { // 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 auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); // create a window QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); @@ -229,13 +229,13 @@ void PointerInputTest::testWarpingUpdatesFocus() void PointerInputTest::testWarpingGeneratesPointerMotion() { // this test verifies that warping the pointer creates pointer motion events - using namespace KWayland::Client; + // create pointer and signal spy for enter and motion auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy movedSpy(pointer, &Pointer::motion); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy movedSpy(pointer, &KWayland::Client::Pointer::motion); // create a window QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); @@ -264,13 +264,12 @@ void PointerInputTest::testWarpingDuringFilter() { // this test verifies that pointer motion is handled correctly if // the pointer gets warped during processing of input events - using namespace KWayland::Client; // create pointer auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy movedSpy(pointer, &Pointer::motion); + QSignalSpy movedSpy(pointer, &KWayland::Client::Pointer::motion); // warp cursor into expected geometry 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 // screen due to removal of screen - using namespace KWayland::Client; // create pointer and signal spy for enter and motion auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); // create a window QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); @@ -525,12 +523,12 @@ void PointerInputTest::testModifierClickUnrestrictedMove_data() void PointerInputTest::testModifierClickUnrestrictedMove() { // this test ensures that Alt+mouse button press triggers unrestricted move - using namespace KWayland::Client; + // create pointer and signal spy for button events auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged); + QSignalSpy buttonSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged); // first modify the config for this run QFETCH(QString, modKey); @@ -642,12 +640,12 @@ void PointerInputTest::testModifierClickUnrestrictedFullscreenMove() void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled() { // this test ensures that Alt+mouse button press triggers unrestricted move - using namespace KWayland::Client; + // create pointer and signal spy for button events auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged); + QSignalSpy buttonSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged); // first modify the config for this run 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 // pass the wheel to the window - using namespace KWayland::Client; + // create pointer and signal spy for button events auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy axisSpy(pointer, &Pointer::axisChanged); + QSignalSpy axisSpy(pointer, &KWayland::Client::Pointer::axisChanged); // first modify the config for this run QFETCH(QString, modKey); @@ -776,12 +774,12 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled() { // this test verifies that mod+wheel performs a window operation and does not // pass the wheel to the window - using namespace KWayland::Client; + // create pointer and signal spy for button events auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy axisSpy(pointer, &Pointer::axisChanged); + QSignalSpy axisSpy(pointer, &KWayland::Client::Pointer::axisChanged); // first modify the config for this run KConfigGroup group = kwinApp()->config()->group("MouseBindings"); @@ -827,11 +825,10 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled() void PointerInputTest::testScrollAction() { // this test verifies that scroll on inactive window performs a mouse action - using namespace KWayland::Client; auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy axisSpy(pointer, &Pointer::axisChanged); + QSignalSpy axisSpy(pointer, &KWayland::Client::Pointer::axisChanged); // first modify the config for this run KConfigGroup group = kwinApp()->config()->group("MouseBindings"); @@ -875,7 +872,6 @@ void PointerInputTest::testScrollAction() void PointerInputTest::testFocusFollowsMouse() { - using namespace KWayland::Client; // need to create a pointer, otherwise it doesn't accept focus auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); @@ -967,7 +963,6 @@ void PointerInputTest::testMouseActionInactiveWindow() { // this test performs the mouse button window action on an inactive window // it should activate the window and raise it - using namespace KWayland::Client; // first modify the config for this run - disable FocusFollowsMouse KConfigGroup group = kwinApp()->config()->group("Windows"); @@ -1051,12 +1046,12 @@ void PointerInputTest::testMouseActionActiveWindow() // this test verifies the mouse action performed on an active window // for all buttons it should trigger a window raise depending on the // click raise option - using namespace KWayland::Client; + // create a button spy - all clicks should be passed through auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged); + QSignalSpy buttonSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged); // adjust config for this run QFETCH(bool, clickRaise); @@ -1128,12 +1123,12 @@ void PointerInputTest::testMouseActionActiveWindow() void PointerInputTest::testCursorImage() { // 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 auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); // move cursor somewhere the new window won't open auto cursor = Cursors::self()->mouse(); @@ -1230,14 +1225,14 @@ public: void PointerInputTest::testEffectOverrideCursorImage() { // 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 auto pointer = m_seat->createPointer(m_seat); auto cursor = Cursors::self()->mouse(); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); // move cursor somewhere the new window won't open cursor->setPos(800, 800); // here we should have the fallback cursor @@ -1305,14 +1300,13 @@ void PointerInputTest::testPopup() // a button press outside the window should dismiss the popup // first create a parent surface - using namespace KWayland::Client; auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); - QSignalSpy buttonStateChangedSpy(pointer, &Pointer::buttonStateChanged); - QSignalSpy motionSpy(pointer, &Pointer::motion); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); + QSignalSpy buttonStateChangedSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged); + QSignalSpy motionSpy(pointer, &KWayland::Client::Pointer::motion); Cursors::self()->mouse()->setPos(800, 800); @@ -1342,7 +1336,7 @@ void PointerInputTest::testPopup() positioner->set_anchor_rect(0, 0, 80, 20); positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right); positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right); - std::unique_ptr popupSurface = Test::createSurface(); + std::unique_ptr popupSurface = Test::createSurface(); QVERIFY(popupSurface); Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get()); QVERIFY(popupShellSurface); @@ -1383,14 +1377,13 @@ void PointerInputTest::testDecoCancelsPopup() // cancels the popup // first create a parent surface - using namespace KWayland::Client; auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); - QSignalSpy buttonStateChangedSpy(pointer, &Pointer::buttonStateChanged); - QSignalSpy motionSpy(pointer, &Pointer::motion); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); + QSignalSpy buttonStateChangedSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged); + QSignalSpy motionSpy(pointer, &KWayland::Client::Pointer::motion); Cursors::self()->mouse()->setPos(800, 800); @@ -1424,7 +1417,7 @@ void PointerInputTest::testDecoCancelsPopup() positioner->set_anchor_rect(0, 0, 80, 20); positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right); positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right); - std::unique_ptr popupSurface = Test::createSurface(); + std::unique_ptr popupSurface = Test::createSurface(); QVERIFY(popupSurface); Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get()); QVERIFY(popupShellSurface); @@ -1453,12 +1446,11 @@ void PointerInputTest::testWindowUnderCursorWhileButtonPressed() // see BUG: 372876 // first create a parent surface - using namespace KWayland::Client; auto pointer = m_seat->createPointer(m_seat); QVERIFY(pointer); QVERIFY(pointer->isValid()); - QSignalSpy enteredSpy(pointer, &Pointer::entered); - QSignalSpy leftSpy(pointer, &Pointer::left); + QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); + QSignalSpy leftSpy(pointer, &KWayland::Client::Pointer::left); Cursors::self()->mouse()->setPos(800, 800); QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); @@ -1485,7 +1477,7 @@ void PointerInputTest::testWindowUnderCursorWhileButtonPressed() positioner->set_anchor_rect(0, 0, 1, 1); positioner->set_anchor(Test::XdgPositioner::anchor_bottom_right); positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right); - std::unique_ptr popupSurface = Test::createSurface(); + std::unique_ptr popupSurface = Test::createSurface(); QVERIFY(popupSurface); Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get()); QVERIFY(popupShellSurface); @@ -1638,7 +1630,6 @@ void PointerInputTest::testResizeCursor() QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); // create a test window - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -1726,7 +1717,6 @@ void PointerInputTest::testMoveCursor() QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered); // create a test window - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr 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. // Create a test window. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr 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. // Create a test window. - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr inputRegion(m_compositor->createRegion(QRegion())); diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp index 239d3cedd6..b7d0eefb55 100644 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -147,8 +147,6 @@ void QuickTilingTest::testQuickTiling_data() void QuickTilingTest::testQuickTiling() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -220,8 +218,6 @@ void QuickTilingTest::testQuickMaximizing_data() void QuickTilingTest::testQuickMaximizing() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -324,8 +320,6 @@ void QuickTilingTest::testQuickTilingKeyboardMove_data() void QuickTilingTest::testQuickTilingKeyboardMove() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); @@ -391,8 +385,6 @@ void QuickTilingTest::testQuickTilingPointerMove_data() void QuickTilingTest::testQuickTilingPointerMove() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -470,11 +462,10 @@ void QuickTilingTest::testQuickTilingTouchMove() { // test verifies that touch on decoration also allows quick tiling // see BUG: 390113 - using namespace KWayland::Client; std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); - std::unique_ptr deco(Test::waylandServerSideDecoration()->create(surface.get())); + std::unique_ptr deco(Test::waylandServerSideDecoration()->create(surface.get())); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly)); QVERIFY(shellSurface != nullptr); @@ -717,8 +708,6 @@ void QuickTilingTest::testShortcut_data() void QuickTilingTest::testShortcut() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); @@ -800,8 +789,6 @@ void QuickTilingTest::testScript_data() void QuickTilingTest::testScript() { - using namespace KWayland::Client; - std::unique_ptr surface(Test::createSurface()); QVERIFY(surface != nullptr); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); diff --git a/autotests/integration/screen_changes_test.cpp b/autotests/integration/screen_changes_test.cpp index d1451b7f2b..1731792fda 100644 --- a/autotests/integration/screen_changes_test.cpp +++ b/autotests/integration/screen_changes_test.cpp @@ -19,7 +19,6 @@ #include using namespace KWin; -using namespace KWayland::Client; 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 // first create a registry to get signals about Outputs announced/removed - Registry registry; - QSignalSpy allAnnounced(®istry, &Registry::interfacesAnnounced); - QSignalSpy outputAnnouncedSpy(®istry, &Registry::outputAnnounced); - QSignalSpy outputRemovedSpy(®istry, &Registry::outputRemoved); + KWayland::Client::Registry registry; + QSignalSpy allAnnounced(®istry, &KWayland::Client::Registry::interfacesAnnounced); + QSignalSpy outputAnnouncedSpy(®istry, &KWayland::Client::Registry::outputAnnounced); + QSignalSpy outputRemovedSpy(®istry, &KWayland::Client::Registry::outputRemoved); registry.create(Test::waylandConnection()); QVERIFY(registry.isValid()); registry.setup(); 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); // should be one output @@ -128,13 +127,13 @@ void ScreenChangesTest::testScreenAddRemove() QCOMPARE(o2->pixelSize(), serverOutput2->modeSize()); // and check XDGOutput is synced - std::unique_ptr xdgO1(xdgOutputManager->getXdgOutput(o1.get())); - QSignalSpy xdgO1ChangedSpy(xdgO1.get(), &XdgOutput::changed); + std::unique_ptr xdgO1(xdgOutputManager->getXdgOutput(o1.get())); + QSignalSpy xdgO1ChangedSpy(xdgO1.get(), &KWayland::Client::XdgOutput::changed); QVERIFY(xdgO1ChangedSpy.wait()); QCOMPARE(xdgO1->logicalPosition(), serverOutput1->geometry().topLeft()); QCOMPARE(xdgO1->logicalSize(), serverOutput1->geometry().size()); - std::unique_ptr xdgO2(xdgOutputManager->getXdgOutput(o2.get())); - QSignalSpy xdgO2ChangedSpy(xdgO2.get(), &XdgOutput::changed); + std::unique_ptr xdgO2(xdgOutputManager->getXdgOutput(o2.get())); + QSignalSpy xdgO2ChangedSpy(xdgO2.get(), &KWayland::Client::XdgOutput::changed); QVERIFY(xdgO2ChangedSpy.wait()); QCOMPARE(xdgO2->logicalPosition(), serverOutput2->geometry().topLeft()); QCOMPARE(xdgO2->logicalSize(), serverOutput2->geometry().size()); diff --git a/autotests/integration/scripting/minimizeall_test.cpp b/autotests/integration/scripting/minimizeall_test.cpp index c122d3c7fe..1c969a79a2 100644 --- a/autotests/integration/scripting/minimizeall_test.cpp +++ b/autotests/integration/scripting/minimizeall_test.cpp @@ -102,8 +102,6 @@ void MinimizeAllScriptTest::testMinimizeUnminimize() // This test verifies that all windows are minimized when Meta+Shift+D // is pressed, and unminimized when the shortcut is pressed once again. - using namespace KWayland::Client; - // Create a couple of test windows. std::unique_ptr surface1(Test::createSurface()); std::unique_ptr shellSurface1(Test::createXdgToplevelSurface(surface1.get())); diff --git a/autotests/integration/showing_desktop_test.cpp b/autotests/integration/showing_desktop_test.cpp index 1bbd79d7e1..4fa1d83a77 100644 --- a/autotests/integration/showing_desktop_test.cpp +++ b/autotests/integration/showing_desktop_test.cpp @@ -17,7 +17,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_showing_desktop-0"); @@ -82,9 +81,9 @@ void ShowingDesktopTest::testRestoreFocusWithDesktopWindow() QVERIFY(desktopSurface != nullptr); std::unique_ptr desktopShellSurface(Test::createXdgToplevelSurface(desktopSurface.get())); QVERIFY(desktopSurface != nullptr); - std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(desktopSurface.get())); + std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(desktopSurface.get())); 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); QVERIFY(desktop); diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp index 96b9876045..6c3e943331 100644 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -134,7 +134,6 @@ void StrutsTest::testWaylandStruts_data() void StrutsTest::testWaylandStruts() { // this test verifies that struts on Wayland panels are handled correctly - using namespace KWayland::Client; VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop(); const QList outputs = workspace()->outputs(); @@ -167,9 +166,9 @@ void StrutsTest::testWaylandStruts() const QRect windowGeometry = *it; std::unique_ptr surface = Test::createSurface(); 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->setRole(PlasmaShellSurface::Role::Panel); + plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested); surface->commit(KWayland::Client::Surface::CommitFlag::None); @@ -225,13 +224,12 @@ void StrutsTest::testMoveWaylandPanel() const QList outputs = workspace()->outputs(); // this test verifies that repositioning a Wayland panel updates the client area - using namespace KWayland::Client; const QRect windowGeometry(0, 1000, 1280, 24); std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly)); - std::unique_ptr plasmaSurface(m_plasmaShell->createSurface(surface.get())); + std::unique_ptr plasmaSurface(m_plasmaShell->createSurface(surface.get())); plasmaSurface->setPosition(windowGeometry.topLeft()); - plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); + plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested); surface->commit(KWayland::Client::Surface::CommitFlag::None); @@ -264,8 +262,6 @@ void StrutsTest::testMoveWaylandPanel() void StrutsTest::testWaylandMobilePanel() { - using namespace KWayland::Client; - VirtualDesktop *desktop = VirtualDesktopManager::self()->currentDesktop(); const QList outputs = workspace()->outputs(); @@ -279,9 +275,9 @@ void StrutsTest::testWaylandMobilePanel() const QRect windowGeometry(0, 0, 1280, 60); std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly)); - std::unique_ptr plasmaSurface(m_plasmaShell->createSurface(surface.get())); + std::unique_ptr plasmaSurface(m_plasmaShell->createSurface(surface.get())); plasmaSurface->setPosition(windowGeometry.topLeft()); - plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); + plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested); surface->commit(KWayland::Client::Surface::CommitFlag::None); @@ -306,9 +302,9 @@ void StrutsTest::testWaylandMobilePanel() const QRect windowGeometry2(0, 874, 1280, 150); std::unique_ptr surface2(Test::createSurface()); std::unique_ptr shellSurface2(Test::createXdgToplevelSurface(surface2.get(), Test::CreationSetup::CreateOnly)); - std::unique_ptr plasmaSurface2(m_plasmaShell->createSurface(surface2.get())); + std::unique_ptr plasmaSurface2(m_plasmaShell->createSurface(surface2.get())); plasmaSurface2->setPosition(windowGeometry2.topLeft()); - plasmaSurface2->setRole(PlasmaShellSurface::Role::Panel); + plasmaSurface2->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); QSignalSpy configureRequestedSpy2(shellSurface2->xdgSurface(), &Test::XdgSurface::configureRequested); surface2->commit(KWayland::Client::Surface::CommitFlag::None); diff --git a/autotests/integration/tabbox_test.cpp b/autotests/integration/tabbox_test.cpp index 2b04fa62e6..60ab8e7123 100644 --- a/autotests/integration/tabbox_test.cpp +++ b/autotests/integration/tabbox_test.cpp @@ -22,7 +22,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_tabbox-0"); diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index 5f3d0ad14e..a16a562228 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -48,8 +48,6 @@ #include #include -using namespace KWayland::Client; - namespace KWin { namespace Test @@ -227,27 +225,27 @@ IdleInhibitorV1::~IdleInhibitorV1() static struct { - ConnectionThread *connection = nullptr; - EventQueue *queue = nullptr; + KWayland::Client::ConnectionThread *connection = nullptr; + KWayland::Client::EventQueue *queue = nullptr; KWayland::Client::Compositor *compositor = nullptr; - SubCompositor *subCompositor = nullptr; - ServerSideDecorationManager *decoration = nullptr; - ShadowManager *shadowManager = nullptr; + KWayland::Client::SubCompositor *subCompositor = nullptr; + KWayland::Client::ServerSideDecorationManager *decoration = nullptr; + KWayland::Client::ShadowManager *shadowManager = nullptr; XdgShell *xdgShell = nullptr; - ShmPool *shm = nullptr; - Seat *seat = nullptr; - PlasmaShell *plasmaShell = nullptr; - PlasmaWindowManagement *windowManagement = nullptr; - PointerConstraints *pointerConstraints = nullptr; - Registry *registry = nullptr; + KWayland::Client::ShmPool *shm = nullptr; + KWayland::Client::Seat *seat = nullptr; + KWayland::Client::PlasmaShell *plasmaShell = nullptr; + KWayland::Client::PlasmaWindowManagement *windowManagement = nullptr; + KWayland::Client::PointerConstraints *pointerConstraints = nullptr; + KWayland::Client::Registry *registry = nullptr; WaylandOutputManagementV2 *outputManagementV2 = nullptr; QThread *thread = nullptr; QVector outputs; QVector outputDevicesV2; IdleInhibitManagerV1 *idleInhibitManagerV1 = nullptr; - AppMenuManager *appMenu = nullptr; + KWayland::Client::AppMenuManager *appMenu = nullptr; XdgDecorationManagerV1 *xdgDecorationManagerV1 = nullptr; - TextInputManager *textInputManager = nullptr; + KWayland::Client::TextInputManager *textInputManager = nullptr; QtWayland::zwp_input_panel_v1 *inputPanelV1 = nullptr; MockInputMethod *inputMethodV1 = nullptr; QtWayland::zwp_input_method_context_v1 *inputMethodContextV1 = nullptr; @@ -312,8 +310,8 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags) } KWin::waylandServer()->display()->createClient(sx[0]); // setup connection - s_waylandConnection.connection = new ConnectionThread; - QSignalSpy connectedSpy(s_waylandConnection.connection, &ConnectionThread::connected); + s_waylandConnection.connection = new KWayland::Client::ConnectionThread; + QSignalSpy connectedSpy(s_waylandConnection.connection, &KWayland::Client::ConnectionThread::connected); if (!connectedSpy.isValid()) { return false; } @@ -328,17 +326,17 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags) return false; } - s_waylandConnection.queue = new EventQueue; + s_waylandConnection.queue = new KWayland::Client::EventQueue; s_waylandConnection.queue->setup(s_waylandConnection.connection); if (!s_waylandConnection.queue->isValid()) { return false; } - Registry *registry = new Registry; + KWayland::Client::Registry *registry = new KWayland::Client::Registry; s_waylandConnection.registry = registry; 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); s_waylandConnection.outputs << output; 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 (interface == QByteArrayLiteral("zwp_input_method_v1")) { 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()) { return false; } @@ -432,67 +430,67 @@ bool setupWaylandConnection(AdditionalWaylandInterfaces flags) 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()) { 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()) { 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()) { return false; } 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()) { return false; } } if (flags.testFlag(AdditionalWaylandInterface::ShadowManager)) { - s_waylandConnection.shadowManager = registry->createShadowManager(registry->interface(Registry::Interface::Shadow).name, - registry->interface(Registry::Interface::Shadow).version); + s_waylandConnection.shadowManager = registry->createShadowManager(registry->interface(KWayland::Client::Registry::Interface::Shadow).name, + registry->interface(KWayland::Client::Registry::Interface::Shadow).version); if (!s_waylandConnection.shadowManager->isValid()) { return false; } } if (flags.testFlag(AdditionalWaylandInterface::Decoration)) { - s_waylandConnection.decoration = registry->createServerSideDecorationManager(registry->interface(Registry::Interface::ServerSideDecorationManager).name, - registry->interface(Registry::Interface::ServerSideDecorationManager).version); + s_waylandConnection.decoration = registry->createServerSideDecorationManager(registry->interface(KWayland::Client::Registry::Interface::ServerSideDecorationManager).name, + registry->interface(KWayland::Client::Registry::Interface::ServerSideDecorationManager).version); if (!s_waylandConnection.decoration->isValid()) { return false; } } if (flags.testFlag(AdditionalWaylandInterface::PlasmaShell)) { - s_waylandConnection.plasmaShell = registry->createPlasmaShell(registry->interface(Registry::Interface::PlasmaShell).name, - registry->interface(Registry::Interface::PlasmaShell).version); + s_waylandConnection.plasmaShell = registry->createPlasmaShell(registry->interface(KWayland::Client::Registry::Interface::PlasmaShell).name, + registry->interface(KWayland::Client::Registry::Interface::PlasmaShell).version); if (!s_waylandConnection.plasmaShell->isValid()) { return false; } } if (flags.testFlag(AdditionalWaylandInterface::WindowManagement)) { - s_waylandConnection.windowManagement = registry->createPlasmaWindowManagement(registry->interface(Registry::Interface::PlasmaWindowManagement).name, - registry->interface(Registry::Interface::PlasmaWindowManagement).version); + s_waylandConnection.windowManagement = registry->createPlasmaWindowManagement(registry->interface(KWayland::Client::Registry::Interface::PlasmaWindowManagement).name, + registry->interface(KWayland::Client::Registry::Interface::PlasmaWindowManagement).version); if (!s_waylandConnection.windowManagement->isValid()) { return false; } } if (flags.testFlag(AdditionalWaylandInterface::PointerConstraints)) { - s_waylandConnection.pointerConstraints = registry->createPointerConstraints(registry->interface(Registry::Interface::PointerConstraintsUnstableV1).name, - registry->interface(Registry::Interface::PointerConstraintsUnstableV1).version); + s_waylandConnection.pointerConstraints = registry->createPointerConstraints(registry->interface(KWayland::Client::Registry::Interface::PointerConstraintsUnstableV1).name, + registry->interface(KWayland::Client::Registry::Interface::PointerConstraintsUnstableV1).version); if (!s_waylandConnection.pointerConstraints->isValid()) { return false; } } 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()) { return false; } } 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()) { return false; } @@ -557,7 +555,7 @@ void destroyWaylandConnection() s_waylandConnection.outputDevicesV2.clear(); } -ConnectionThread *waylandConnection() +KWayland::Client::ConnectionThread *waylandConnection() { return s_waylandConnection.connection; } @@ -567,47 +565,47 @@ KWayland::Client::Compositor *waylandCompositor() return s_waylandConnection.compositor; } -SubCompositor *waylandSubCompositor() +KWayland::Client::SubCompositor *waylandSubCompositor() { return s_waylandConnection.subCompositor; } -ShadowManager *waylandShadowManager() +KWayland::Client::ShadowManager *waylandShadowManager() { return s_waylandConnection.shadowManager; } -ShmPool *waylandShmPool() +KWayland::Client::ShmPool *waylandShmPool() { return s_waylandConnection.shm; } -Seat *waylandSeat() +KWayland::Client::Seat *waylandSeat() { return s_waylandConnection.seat; } -ServerSideDecorationManager *waylandServerSideDecoration() +KWayland::Client::ServerSideDecorationManager *waylandServerSideDecoration() { return s_waylandConnection.decoration; } -PlasmaShell *waylandPlasmaShell() +KWayland::Client::PlasmaShell *waylandPlasmaShell() { return s_waylandConnection.plasmaShell; } -PlasmaWindowManagement *waylandWindowManagement() +KWayland::Client::PlasmaWindowManagement *waylandWindowManagement() { return s_waylandConnection.windowManagement; } -PointerConstraints *waylandPointerConstraints() +KWayland::Client::PointerConstraints *waylandPointerConstraints() { return s_waylandConnection.pointerConstraints; } -AppMenuManager *waylandAppMenuManager() +KWayland::Client::AppMenuManager *waylandAppMenuManager() { return s_waylandConnection.appMenu; } @@ -617,7 +615,7 @@ KWin::Test::WaylandOutputManagementV2 *waylandOutputManagementV2() return s_waylandConnection.outputManagementV2; } -TextInputManager *waylandTextInputManager() +KWayland::Client::TextInputManager *waylandTextInputManager() { return s_waylandConnection.textInputManager; } @@ -661,7 +659,7 @@ bool waitForWaylandPointer() if (!s_waylandConnection.seat) { return false; } - QSignalSpy hasPointerSpy(s_waylandConnection.seat, &Seat::hasPointerChanged); + QSignalSpy hasPointerSpy(s_waylandConnection.seat, &KWayland::Client::Seat::hasPointerChanged); if (!hasPointerSpy.isValid()) { return false; } @@ -673,7 +671,7 @@ bool waitForWaylandTouch() if (!s_waylandConnection.seat) { return false; } - QSignalSpy hasTouchSpy(s_waylandConnection.seat, &Seat::hasTouchChanged); + QSignalSpy hasTouchSpy(s_waylandConnection.seat, &KWayland::Client::Seat::hasTouchChanged); if (!hasTouchSpy.isValid()) { return false; } @@ -685,7 +683,7 @@ bool waitForWaylandKeyboard() if (!s_waylandConnection.seat) { return false; } - QSignalSpy hasKeyboardSpy(s_waylandConnection.seat, &Seat::hasKeyboardChanged); + QSignalSpy hasKeyboardSpy(s_waylandConnection.seat, &KWayland::Client::Seat::hasKeyboardChanged); if (!hasKeyboardSpy.isValid()) { return false; } @@ -748,7 +746,7 @@ std::unique_ptr createSurface() 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) { return nullptr; diff --git a/autotests/integration/touch_input_test.cpp b/autotests/integration/touch_input_test.cpp index d1e69e9926..caae4eac56 100644 --- a/autotests/integration/touch_input_test.cpp +++ b/autotests/integration/touch_input_test.cpp @@ -68,7 +68,6 @@ void TouchInputTest::initTestCase() void TouchInputTest::init() { - using namespace KWayland::Client; QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1)); QVERIFY(Test::waitForWaylandTouch()); m_touch = Test::waylandSeat()->createTouch(Test::waylandSeat()); @@ -88,7 +87,6 @@ void TouchInputTest::cleanup() std::pair> TouchInputTest::showWindow(bool decorated) { - using namespace KWayland::Client; #define VERIFY(statement) \ if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \ return {nullptr, nullptr}; @@ -154,17 +152,16 @@ void TouchInputTest::testMultipleTouchPoints_data() void TouchInputTest::testMultipleTouchPoints() { - using namespace KWayland::Client; QFETCH(bool, decorated); auto [window, surface] = showWindow(decorated); QCOMPARE(window->isDecorated(), decorated); window->move(QPoint(100, 100)); QVERIFY(window); - QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted); - QSignalSpy pointAddedSpy(m_touch, &Touch::pointAdded); - QSignalSpy pointMovedSpy(m_touch, &Touch::pointMoved); - QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved); - QSignalSpy endedSpy(m_touch, &Touch::sequenceEnded); + QSignalSpy sequenceStartedSpy(m_touch, &KWayland::Client::Touch::sequenceStarted); + QSignalSpy pointAddedSpy(m_touch, &KWayland::Client::Touch::pointAdded); + QSignalSpy pointMovedSpy(m_touch, &KWayland::Client::Touch::pointMoved); + QSignalSpy pointRemovedSpy(m_touch, &KWayland::Client::Touch::pointRemoved); + QSignalSpy endedSpy(m_touch, &KWayland::Client::Touch::sequenceEnded); quint32 timestamp = 1; Test::touchDown(1, QPointF(125, 125) + window->clientPos(), timestamp++); @@ -211,13 +208,12 @@ void TouchInputTest::testMultipleTouchPoints() void TouchInputTest::testCancel() { - using namespace KWayland::Client; auto [window, surface] = showWindow(); window->move(QPoint(100, 100)); QVERIFY(window); - QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted); - QSignalSpy cancelSpy(m_touch, &Touch::sequenceCanceled); - QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved); + QSignalSpy sequenceStartedSpy(m_touch, &KWayland::Client::Touch::sequenceStarted); + QSignalSpy cancelSpy(m_touch, &KWayland::Client::Touch::sequenceCanceled); + QSignalSpy pointRemovedSpy(m_touch, &KWayland::Client::Touch::pointRemoved); quint32 timestamp = 1; Test::touchDown(1, QPointF(125, 125), timestamp++); @@ -233,7 +229,7 @@ void TouchInputTest::testCancel() void TouchInputTest::testTouchMouseAction() { // this test verifies that a touch down on an inactive window will activate it - using namespace KWayland::Client; + // create two windows auto [c1, surface] = showWindow(); QVERIFY(c1); @@ -244,7 +240,7 @@ void TouchInputTest::testTouchMouseAction() QVERIFY(c2->isActive()); // 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; Test::touchDown(1, c1->frameGeometry().center(), timestamp++); diff --git a/autotests/integration/transient_placement.cpp b/autotests/integration/transient_placement.cpp index 912733da4e..e654724949 100644 --- a/autotests/integration/transient_placement.cpp +++ b/autotests/integration/transient_placement.cpp @@ -90,8 +90,6 @@ void TransientPlacementTest::cleanup() void TransientPlacementTest::testXdgPopup_data() { - using namespace KWayland::Client; - QTest::addColumn("parentSize"); QTest::addColumn("parentPosition"); QTest::addColumn("layout"); @@ -407,8 +405,6 @@ void TransientPlacementTest::testXdgPopup_data() void TransientPlacementTest::testXdgPopup() { - using namespace KWayland::Client; - // 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 // some test cases also verify that the transient fits on the screen @@ -462,19 +458,17 @@ void TransientPlacementTest::testXdgPopup() void TransientPlacementTest::testXdgPopupWithPanel() { - using namespace KWayland::Client; - const Output *output = workspace()->activeOutput(); std::unique_ptr surface{Test::createSurface()}; QVERIFY(surface != nullptr); std::unique_ptr dockShellSurface{Test::createXdgToplevelSurface(surface.get())}; QVERIFY(dockShellSurface != nullptr); - std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get())); + std::unique_ptr plasmaSurface(Test::waylandPlasmaShell()->createSurface(surface.get())); QVERIFY(plasmaSurface != nullptr); - plasmaSurface->setRole(PlasmaShellSurface::Role::Panel); + plasmaSurface->setRole(KWayland::Client::PlasmaShellSurface::Role::Panel); 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 auto dock = Test::renderAndWaitForShown(surface.get(), QSize(1280, 50), Qt::blue); diff --git a/autotests/integration/virtual_desktop_test.cpp b/autotests/integration/virtual_desktop_test.cpp index e01fad11a3..83524d1c55 100644 --- a/autotests/integration/virtual_desktop_test.cpp +++ b/autotests/integration/virtual_desktop_test.cpp @@ -18,7 +18,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_virtualdesktop-0"); diff --git a/autotests/integration/window_selection_test.cpp b/autotests/integration/window_selection_test.cpp index baf9f6da0d..370ec2b047 100644 --- a/autotests/integration/window_selection_test.cpp +++ b/autotests/integration/window_selection_test.cpp @@ -28,7 +28,6 @@ #include using namespace KWin; -using namespace KWayland::Client; 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 std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); - QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left); - QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); + QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left); + QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); QVERIFY(window); @@ -169,12 +168,12 @@ void TestWindowSelection::testSelectOnWindowKeyboard() // this test verifies window selection through keyboard key std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); - QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left); - QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); + QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left); + QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); QVERIFY(window); @@ -235,9 +234,9 @@ void TestWindowSelection::testSelectOnWindowKeyboard() void TestWindowSelection::testSelectOnWindowTouch() { // this test verifies window selection through touch - std::unique_ptr touch(Test::waylandSeat()->createTouch()); - QSignalSpy touchStartedSpy(touch.get(), &Touch::sequenceStarted); - QSignalSpy touchCanceledSpy(touch.get(), &Touch::sequenceCanceled); + std::unique_ptr touch(Test::waylandSeat()->createTouch()); + QSignalSpy touchStartedSpy(touch.get(), &KWayland::Client::Touch::sequenceStarted); + QSignalSpy touchCanceledSpy(touch.get(), &KWayland::Client::Touch::sequenceCanceled); std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); 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 std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); - QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left); - QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); + QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left); + QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); QVERIFY(window); @@ -353,12 +352,12 @@ void TestWindowSelection::testCancelOnWindowKeyboard() // this test verifies that cancel window selection through escape key works std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); - QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left); - QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); + QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left); + QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); QVERIFY(window); @@ -408,12 +407,12 @@ void TestWindowSelection::testSelectPointPointer() // this test verifies point selection through pointer works std::unique_ptr surface(Test::createSurface()); std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - std::unique_ptr pointer(Test::waylandSeat()->createPointer()); - std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); - QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered); - QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left); - QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered); - QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left); + std::unique_ptr pointer(Test::waylandSeat()->createPointer()); + std::unique_ptr keyboard(Test::waylandSeat()->createKeyboard()); + QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered); + QSignalSpy pointerLeftSpy(pointer.get(), &KWayland::Client::Pointer::left); + QSignalSpy keyboardEnteredSpy(keyboard.get(), &KWayland::Client::Keyboard::entered); + QSignalSpy keyboardLeftSpy(keyboard.get(), &KWayland::Client::Keyboard::left); auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); QVERIFY(window); diff --git a/autotests/integration/x11_window_test.cpp b/autotests/integration/x11_window_test.cpp index 39be6f5885..75aa4b1e84 100644 --- a/autotests/integration/x11_window_test.cpp +++ b/autotests/integration/x11_window_test.cpp @@ -25,7 +25,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_x11_window-0"); class X11WindowTest : public QObject diff --git a/autotests/integration/xdgshellwindow_rules_test.cpp b/autotests/integration/xdgshellwindow_rules_test.cpp index 86513224ca..0d6950322f 100644 --- a/autotests/integration/xdgshellwindow_rules_test.cpp +++ b/autotests/integration/xdgshellwindow_rules_test.cpp @@ -26,7 +26,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow_rules-0"); diff --git a/autotests/integration/xdgshellwindow_test.cpp b/autotests/integration/xdgshellwindow_test.cpp index 144e06a23a..86f8592221 100644 --- a/autotests/integration/xdgshellwindow_test.cpp +++ b/autotests/integration/xdgshellwindow_test.cpp @@ -47,7 +47,6 @@ #include using namespace KWin; -using namespace KWayland::Client; static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow-0"); @@ -227,7 +226,7 @@ void TestXdgShellWindow::testMapUnmap() QCOMPARE(configureRequestedSpy.count(), 2); // 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); QVERIFY(Test::waitForWindowDestroyed(window)); @@ -853,7 +852,7 @@ void TestXdgShellWindow::testAppMenu() std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); QVERIFY(window); - std::unique_ptr menu(Test::waylandAppMenuManager()->create(surface.get())); + std::unique_ptr menu(Test::waylandAppMenuManager()->create(surface.get())); QSignalSpy spy(window, &Window::hasApplicationMenuChanged); menu->setAddress("service.name", "object/path"); spy.wait(); @@ -1116,7 +1115,7 @@ void TestXdgShellWindow::testXdgWindowGeometryIsntSet() QCOMPARE(window->bufferGeometry().size(), QSize(100, 50)); std::unique_ptr childSurface(Test::createSurface()); - std::unique_ptr subSurface(Test::createSubSurface(childSurface.get(), surface.get())); + std::unique_ptr subSurface(Test::createSubSurface(childSurface.get(), surface.get())); QVERIFY(subSurface); subSurface->setPosition(QPoint(-20, -10)); Test::render(childSurface.get(), QSize(100, 50), Qt::blue); @@ -1200,7 +1199,7 @@ void TestXdgShellWindow::testXdgWindowGeometryAttachSubSurface() QCOMPARE(window->bufferGeometry().size(), QSize(200, 100)); std::unique_ptr childSurface(Test::createSurface()); - std::unique_ptr subSurface(Test::createSubSurface(childSurface.get(), surface.get())); + std::unique_ptr subSurface(Test::createSubSurface(childSurface.get(), surface.get())); QVERIFY(subSurface); subSurface->setPosition(QPoint(-20, -20)); Test::render(childSurface.get(), QSize(100, 50), Qt::blue);