diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt index 28d701a304..0d2f60e00d 100644 --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -127,7 +127,6 @@ integrationTest(WAYLAND_ONLY NAME testLayerShellV1Window SRCS layershellv1window integrationTest(WAYLAND_ONLY NAME testVirtualDesktop SRCS virtual_desktop_test.cpp) integrationTest(WAYLAND_ONLY NAME testXdgShellWindowRules SRCS xdgshellwindow_rules_test.cpp) integrationTest(WAYLAND_ONLY NAME testIdleInhibition SRCS idle_inhibition_test.cpp) -integrationTest(WAYLAND_ONLY NAME testDontCrashCursorPhysicalSizeEmpty SRCS dont_crash_cursor_physical_size_empty.cpp) integrationTest(WAYLAND_ONLY NAME testDontCrashReinitializeCompositor SRCS dont_crash_reinitialize_compositor.cpp) integrationTest(WAYLAND_ONLY NAME testNoGlobalShortcuts SRCS no_global_shortcuts_test.cpp) integrationTest(WAYLAND_ONLY NAME testBufferSizeChange SRCS buffer_size_change_test.cpp ) diff --git a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp deleted file mode 100644 index 9c0aae5f63..0000000000 --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - KWin - the KDE window manager - This file is part of the KDE project. - - SPDX-FileCopyrightText: 2018 Martin Flöser - - SPDX-License-Identifier: GPL-2.0-or-later -*/ -#include "kwin_wayland_test.h" - -#include "composite.h" -#include "core/platform.h" -#include "cursor.h" -#include "effectloader.h" -#include "effects.h" -#include "wayland/display.h" -#include "wayland/output_interface.h" -#include "wayland_server.h" -#include "workspace.h" -#include "x11window.h" - -#include - -#include -#include -#include - -using namespace KWin; -using namespace KWayland::Client; -static const QString s_socketName = QStringLiteral("wayland_test_kwin_crash_cursor_physical_size_empty-0"); - -class DontCrashCursorPhysicalSizeEmpty : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void init(); - void initTestCase(); - void cleanup(); - void testMoveCursorOverDeco(); -}; - -void DontCrashCursorPhysicalSizeEmpty::init() -{ - QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Decoration)); - - workspace()->setActiveOutput(QPoint(640, 512)); - KWin::Cursors::self()->mouse()->setPos(QPoint(640, 512)); -} - -void DontCrashCursorPhysicalSizeEmpty::cleanup() -{ - Test::destroyWaylandConnection(); -} - -void DontCrashCursorPhysicalSizeEmpty::initTestCase() -{ - qRegisterMetaType(); - QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); - kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); - QVERIFY(waylandServer()->init(s_socketName)); - QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); - - if (!QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons/DMZ-White/index.theme")).isEmpty()) { - qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White")); - } else { - // might be vanilla-dmz (e.g. Arch, FreeBSD) - qputenv("XCURSOR_THEME", QByteArrayLiteral("Vanilla-DMZ")); - } - qputenv("XCURSOR_SIZE", QByteArrayLiteral("0")); - - kwinApp()->start(); - QVERIFY(applicationStartedSpy.wait()); -} - -void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco() -{ - // This test ensures that there is no endless recursion if the cursor theme cannot be created - // a reason for creation failure could be physical size not existing - // see BUG: 390314 - std::unique_ptr surface(Test::createSurface()); - Test::waylandServerSideDecoration()->create(surface.get(), surface.get()); - std::unique_ptr shellSurface(Test::createXdgToplevelSurface(surface.get())); - - auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue); - QVERIFY(window); - QVERIFY(window->isDecorated()); - - // destroy physical size - KWaylandServer::Display *display = waylandServer()->display(); - auto output = display->outputs().first(); - output->setPhysicalSize(QSize(0, 0)); - // and fake a cursor theme change, so that the theme gets recreated - Q_EMIT KWin::Cursors::self()->mouse()->themeChanged(); - - KWin::Cursors::self()->mouse()->setPos(QPoint(window->frameGeometry().center().x(), window->clientPos().y() / 2)); -} - -WAYLANDTEST_MAIN(DontCrashCursorPhysicalSizeEmpty) -#include "dont_crash_cursor_physical_size_empty.moc"