diff --git a/CMakeLists.txt b/CMakeLists.txt index 84d564b297..8ed4bcb61e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,14 +46,9 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS UiTools Widgets ) -if (QT_MAJOR_VERSION EQUAL "5") - find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras) - find_package(Qt6XkbCommonSupport REQUIRED) -else() - find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient ShaderTools) - if (Qt6WaylandClient_VERSION VERSION_LESS "6.4.1") # TODO Plasma 6: Drop once minimum Qt version is 6.4.1+ - include(Qt6WaylandClientMacrosKde) - endif() +find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient ShaderTools) +if (Qt6WaylandClient_VERSION VERSION_LESS "6.4.1") # TODO Plasma 6: Drop once minimum Qt version is 6.4.1+ + include(Qt6WaylandClientMacrosKde) endif() find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} CONFIG QUIET) @@ -210,14 +205,6 @@ set_package_properties(PlasmaWaylandProtocols PROPERTIES URL "https://invent.kde.org/libraries/plasma-wayland-protocols/" ) -if (QT_MAJOR_VERSION EQUAL "5") - find_package(QtWaylandScanner) - set_package_properties(QtWaylandScanner PROPERTIES - TYPE REQUIRED - PURPOSE "Required for building KWin with Wayland support" - ) -endif() - find_package(XKB 0.7.0) set_package_properties(XKB PROPERTIES TYPE REQUIRED @@ -313,14 +300,6 @@ set_package_properties(X11_XCB PROPERTIES TYPE OPTIONAL ) -# dependencies for QPA plugin -if (QT_MAJOR_VERSION EQUAL "5") - find_package(Qt6FontDatabaseSupport REQUIRED) - find_package(Qt6ThemeSupport REQUIRED) - find_package(Qt6ServiceSupport REQUIRED) - find_package(Qt6EventDispatcherSupport REQUIRED) -endif() - find_package(Freetype) set_package_properties(Freetype PROPERTIES DESCRIPTION "A font rendering engine" diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index aaadf7210a..567f8aaab3 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -51,6 +51,7 @@ set_target_properties(testClientMachine PROPERTIES COMPILE_DEFINITIONS "NO_NONE_ target_link_libraries(testClientMachine Qt::Concurrent + Qt::GuiPrivate Qt::Test Qt::Widgets @@ -62,11 +63,6 @@ target_link_libraries(testClientMachine ${X11_X11_LIB} # to make jenkins happy ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testClientMachine Qt::X11Extras) -else() - target_link_libraries(testClientMachine Qt::GuiPrivate) -endif() add_test(NAME kwin-testClientMachine COMMAND testClientMachine) ecm_mark_as_test(testClientMachine) @@ -76,6 +72,7 @@ ecm_mark_as_test(testClientMachine) add_executable(testXcbWrapper test_xcb_wrapper.cpp xcb_scaling_mock.cpp) target_link_libraries(testXcbWrapper + Qt::GuiPrivate Qt::Test Qt::Widgets @@ -84,11 +81,6 @@ target_link_libraries(testXcbWrapper XCB::XCB ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testXcbWrapper Qt::X11Extras) -else() - target_link_libraries(testXcbWrapper Qt::GuiPrivate) -endif() add_test(NAME kwin-testXcbWrapper COMMAND testXcbWrapper) ecm_mark_as_test(testXcbWrapper) @@ -96,6 +88,7 @@ if (XCB_ICCCM_FOUND) add_executable(testXcbSizeHints test_xcb_size_hints.cpp xcb_scaling_mock.cpp) set_target_properties(testXcbSizeHints PROPERTIES COMPILE_DEFINITIONS "NO_NONE_WINDOW") target_link_libraries(testXcbSizeHints + Qt::GuiPrivate Qt::Test Qt::Widgets @@ -105,11 +98,6 @@ if (XCB_ICCCM_FOUND) XCB::ICCCM XCB::XCB ) - if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testXcbSizeHints Qt::X11Extras) - else() - target_link_libraries(testXcbSizeHints Qt::GuiPrivate) - endif() add_test(NAME kwin-testXcbSizeHints COMMAND testXcbSizeHints) ecm_mark_as_test(testXcbSizeHints) endif() @@ -120,6 +108,7 @@ endif() add_executable(testXcbWindow test_xcb_window.cpp xcb_scaling_mock.cpp) target_link_libraries(testXcbWindow + Qt::GuiPrivate Qt::Test Qt::Widgets @@ -128,11 +117,6 @@ target_link_libraries(testXcbWindow XCB::XCB ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testXcbWindow Qt::X11Extras) -else() - target_link_libraries(testXcbWindow Qt::GuiPrivate) -endif() add_test(NAME kwin-testXcbWindow COMMAND testXcbWindow) ecm_mark_as_test(testXcbWindow) @@ -213,6 +197,7 @@ target_link_libraries(testXkb kwin Qt::Gui + Qt::GuiPrivate Qt::Test Qt::Widgets @@ -223,11 +208,6 @@ target_link_libraries(testXkb XKB::XKB ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testXkb Qt6::XkbCommonSupportPrivate) -else() - target_link_libraries(testXkb Qt::GuiPrivate) -endif() add_test(NAME kwin-testXkb COMMAND testXkb) ecm_mark_as_test(testXkb) diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt index 9f09686646..9342154c62 100644 --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -1,61 +1,23 @@ add_subdirectory(helper) add_library(KWinIntegrationTestFramework SHARED) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml - BASENAME input-method-unstable-v1 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml - BASENAME text-input-unstable-v3 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL protocols/wlr-layer-shell-unstable-v1.xml - BASENAME wlr-layer-shell-unstable-v1 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml - BASENAME xdg-shell - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml - BASENAME xdg-decoration-unstable-v1 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml - BASENAME idle-inhibit-unstable-v1 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-device-v2.xml - BASENAME kde-output-device-v2 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-management-v2.xml - BASENAME kde-output-management-v2 - ) - ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework - PROTOCOL ${WaylandProtocols_DATADIR}/staging/fractional-scale/fractional-scale-v1.xml - BASENAME fractional-scale-v1 - ) -else() - qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework - NO_INCLUDE_CORE_ONLY - FILES - ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml - ) - qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework - FILES - ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml - ${CMAKE_CURRENT_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml - ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml - ${WaylandProtocols_DATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml - ${WaylandProtocols_DATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml - ${WaylandProtocols_DATADIR}/staging/fractional-scale/fractional-scale-v1.xml - ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-device-v2.xml - ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-management-v2.xml - ) -endif() + +qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework + NO_INCLUDE_CORE_ONLY + FILES + ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml +) +qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework + FILES + ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml + ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml + ${WaylandProtocols_DATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml + ${WaylandProtocols_DATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml + ${WaylandProtocols_DATADIR}/staging/fractional-scale/fractional-scale-v1.xml + ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-device-v2.xml + ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-output-management-v2.xml +) target_sources(KWinIntegrationTestFramework PRIVATE ../../src/cursor.cpp diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp index f14c4b80ef..1871bda61a 100644 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -102,23 +102,17 @@ void GlobalShortcutsTest::testNonLatinLayout_data() QTest::newRow("Left Ctrl + Tab") << KEY_LEFTCTRL << Qt::CTRL << KEY_TAB << Qt::Key_Tab; QTest::newRow("Left Ctrl + W") << KEY_LEFTCTRL << Qt::CTRL << KEY_W << Qt::Key_W; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QTest::newRow("Left Ctrl + `") << KEY_LEFTCTRL << Qt::CTRL << KEY_GRAVE << Qt::Key_QuoteLeft; -#endif QTest::newRow("Left Alt + Tab") << KEY_LEFTALT << Qt::ALT << KEY_TAB << Qt::Key_Tab; QTest::newRow("Left Alt + W") << KEY_LEFTALT << Qt::ALT << KEY_W << Qt::Key_W; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QTest::newRow("Left Alt + `") << KEY_LEFTALT << Qt::ALT << KEY_GRAVE << Qt::Key_QuoteLeft; -#endif QTest::newRow("Left Shift + Tab") << KEY_LEFTSHIFT << Qt::SHIFT << KEY_TAB << Qt::Key_Tab; QTest::newRow("Left Meta + Tab") << KEY_LEFTMETA << Qt::META << KEY_TAB << Qt::Key_Tab; QTest::newRow("Left Meta + W") << KEY_LEFTMETA << Qt::META << KEY_W << Qt::Key_W; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QTest::newRow("Left Meta + `") << KEY_LEFTMETA << Qt::META << KEY_GRAVE << Qt::Key_QuoteLeft; -#endif } void GlobalShortcutsTest::testNonLatinLayout() @@ -403,13 +397,6 @@ void GlobalShortcutsTest::testSetupWindowShortcut() QVERIFY(dialog->isInternal()); auto sequenceEdit = workspace()->shortcutDialog()->findChild(); QVERIFY(sequenceEdit); - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - // the QKeySequenceEdit field does not get focus, we need to pass it focus manually - QEXPECT_FAIL("", "Edit does not have focus", Continue); - QVERIFY(sequenceEdit->hasFocus()); - sequenceEdit->setFocus(); -#endif QTRY_VERIFY(sequenceEdit->hasFocus()); quint32 timestamp = 0; diff --git a/autotests/libkwineffects/CMakeLists.txt b/autotests/libkwineffects/CMakeLists.txt index 0bd07c699d..109735ece8 100644 --- a/autotests/libkwineffects/CMakeLists.txt +++ b/autotests/libkwineffects/CMakeLists.txt @@ -17,7 +17,4 @@ kwineffects_unit_tests( add_executable(kwinglplatformtest kwinglplatformtest.cpp mock_gl.cpp ../../src/libkwineffects/kwinglplatform.cpp) add_test(NAME kwineffects-kwinglplatformtest COMMAND kwinglplatformtest) target_link_libraries(kwinglplatformtest Qt::Test Qt::Gui KF6::ConfigCore XCB::XCB) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(kwinglplatformtest Qt::X11Extras) -endif() ecm_mark_as_test(kwinglplatformtest) diff --git a/autotests/tabbox/CMakeLists.txt b/autotests/tabbox/CMakeLists.txt index 592e09cde3..e12fed3f32 100644 --- a/autotests/tabbox/CMakeLists.txt +++ b/autotests/tabbox/CMakeLists.txt @@ -31,9 +31,6 @@ target_link_libraries(testTabBoxClientModel XCB::XCB ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testTabBoxClientModel Qt::X11Extras) -endif() add_test(NAME kwin-testTabBoxClientModel COMMAND testTabBoxClientModel) ecm_mark_as_test(testTabBoxClientModel) @@ -68,9 +65,6 @@ target_link_libraries(testTabBoxHandler XCB::XCB ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(testTabBoxHandler Qt::X11Extras) -endif() add_test(NAME kwin-testTabBoxHandler COMMAND testTabBoxHandler) ecm_mark_as_test(testTabBoxHandler) diff --git a/autotests/tabbox/test_tabbox_clientmodel.cpp b/autotests/tabbox/test_tabbox_clientmodel.cpp index 32e3091769..00669279ba 100644 --- a/autotests/tabbox/test_tabbox_clientmodel.cpp +++ b/autotests/tabbox/test_tabbox_clientmodel.cpp @@ -12,11 +12,8 @@ #include "mock_tabboxhandler.h" #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif + using namespace KWin; void TestTabBoxClientModel::initTestCase() diff --git a/autotests/tabbox/test_tabbox_handler.cpp b/autotests/tabbox/test_tabbox_handler.cpp index c696376a60..2ad9c31d6c 100644 --- a/autotests/tabbox/test_tabbox_handler.cpp +++ b/autotests/tabbox/test_tabbox_handler.cpp @@ -10,11 +10,7 @@ #include "clientmodel.h" #include "mock_tabboxhandler.h" #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif using namespace KWin; diff --git a/autotests/test_client_machine.cpp b/autotests/test_client_machine.cpp index 1cfc36739c..89d533cd76 100644 --- a/autotests/test_client_machine.cpp +++ b/autotests/test_client_machine.cpp @@ -13,11 +13,7 @@ // Qt #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif // xcb #include // system diff --git a/autotests/test_x11_timestamp_update.cpp b/autotests/test_x11_timestamp_update.cpp index 0f9383cc0a..f6f5ca07ea 100644 --- a/autotests/test_x11_timestamp_update.cpp +++ b/autotests/test_x11_timestamp_update.cpp @@ -8,11 +8,7 @@ */ #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include "main.h" #include "utils/common.h" diff --git a/autotests/test_xcb_size_hints.cpp b/autotests/test_xcb_size_hints.cpp index e1d4da84b7..884aa206af 100644 --- a/autotests/test_xcb_size_hints.cpp +++ b/autotests/test_xcb_size_hints.cpp @@ -12,11 +12,7 @@ // Qt #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include // xcb #include diff --git a/autotests/test_xcb_window.cpp b/autotests/test_xcb_window.cpp index 173f15ba9e..86ec824d0f 100644 --- a/autotests/test_xcb_window.cpp +++ b/autotests/test_xcb_window.cpp @@ -12,11 +12,7 @@ // Qt #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif // xcb #include diff --git a/autotests/test_xcb_wrapper.cpp b/autotests/test_xcb_wrapper.cpp index 6eaa41005a..472a7273c7 100644 --- a/autotests/test_xcb_wrapper.cpp +++ b/autotests/test_xcb_wrapper.cpp @@ -12,11 +12,7 @@ // Qt #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include // xcb #include diff --git a/autotests/test_xkb.cpp b/autotests/test_xkb.cpp index f99bfcfc80..a737637b10 100644 --- a/autotests/test_xkb.cpp +++ b/autotests/test_xkb.cpp @@ -133,13 +133,8 @@ static const TransKey g_rgQtToSymX[] = { {XKB_KEY_XF86AudioNext, Qt::Key_MediaNext, Qt::KeyboardModifiers()}, {XKB_KEY_XF86AudioRecord, Qt::Key_MediaRecord, Qt::KeyboardModifiers()}, {XKB_KEY_XF86Mail, Qt::Key_LaunchMail, Qt::KeyboardModifiers()}, -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) {XKB_KEY_XF86MyComputer, Qt::Key_LaunchMedia, Qt::KeyboardModifiers()}, {XKB_KEY_XF86Calculater, Qt::Key_Calculator, Qt::KeyboardModifiers()}, -#else - {XKB_KEY_XF86MyComputer, Qt::Key_Launch0, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Calculator, Qt::Key_Launch1, Qt::KeyboardModifiers()}, -#endif {XKB_KEY_XF86Memo, Qt::Key_Memo, Qt::KeyboardModifiers()}, {XKB_KEY_XF86ToDoList, Qt::Key_ToDoList, Qt::KeyboardModifiers()}, {XKB_KEY_XF86Calendar, Qt::Key_Calendar, Qt::KeyboardModifiers()}, @@ -241,7 +236,6 @@ static const TransKey g_rgQtToSymX[] = { {XKB_KEY_XF86TouchpadOn, Qt::Key_TouchpadOn, Qt::KeyboardModifiers()}, {XKB_KEY_XF86TouchpadOff, Qt::Key_TouchpadOff, Qt::KeyboardModifiers()}, {XKB_KEY_XF86AudioMicMute, Qt::Key_MicMute, Qt::KeyboardModifiers()}, -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) {XKB_KEY_XF86Launch0, Qt::Key_Launch0, Qt::KeyboardModifiers()}, {XKB_KEY_XF86Launch1, Qt::Key_Launch1, Qt::KeyboardModifiers()}, {XKB_KEY_XF86Launch2, Qt::Key_Launch2, Qt::KeyboardModifiers()}, @@ -258,22 +252,6 @@ static const TransKey g_rgQtToSymX[] = { {XKB_KEY_XF86LaunchD, Qt::Key_LaunchD, Qt::KeyboardModifiers()}, {XKB_KEY_XF86LaunchE, Qt::Key_LaunchE, Qt::KeyboardModifiers()}, {XKB_KEY_XF86LaunchF, Qt::Key_LaunchF, Qt::KeyboardModifiers()}, -#else - {XKB_KEY_XF86Launch0, Qt::Key_Launch2, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch1, Qt::Key_Launch3, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch2, Qt::Key_Launch4, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch3, Qt::Key_Launch5, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch4, Qt::Key_Launch6, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch5, Qt::Key_Launch7, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch6, Qt::Key_Launch8, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch7, Qt::Key_Launch9, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch8, Qt::Key_LaunchA, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86Launch9, Qt::Key_LaunchB, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86LaunchA, Qt::Key_LaunchC, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86LaunchB, Qt::Key_LaunchD, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86LaunchC, Qt::Key_LaunchE, Qt::KeyboardModifiers()}, - {XKB_KEY_XF86LaunchD, Qt::Key_LaunchF, Qt::KeyboardModifiers()}, -#endif // Latin-1 {XKB_KEY_exclam, Qt::Key_Exclam, Qt::KeyboardModifiers()}, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09cb97aec4..17624c2b9e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -227,9 +227,6 @@ target_link_libraries(kwin Wayland::Server lcms2::lcms2 ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(kwin Qt6::X11Extras Qt6::XkbCommonSupportPrivate) -endif() if (KWIN_BUILD_NOTIFICATIONS) target_link_libraries(kwin KF6::Notifications) diff --git a/src/backends/x11/standalone/CMakeLists.txt b/src/backends/x11/standalone/CMakeLists.txt index 294402ff28..79f93c12ff 100644 --- a/src/backends/x11/standalone/CMakeLists.txt +++ b/src/backends/x11/standalone/CMakeLists.txt @@ -19,9 +19,6 @@ set(X11PLATFORM_SOURCES add_library(KWinX11Platform OBJECT ${X11PLATFORM_SOURCES}) target_link_libraries(KWinX11Platform kwin KF6::Crash X11::X11 XCB::XKB PkgConfig::XKBX11) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(KWinX11Platform Qt::X11Extras) -endif() if (X11_Xi_FOUND) target_sources(KWinX11Platform PRIVATE x11_standalone_xinputintegration.cpp) target_link_libraries(KWinX11Platform X11::Xi) diff --git a/src/backends/x11/standalone/x11_standalone_backend.cpp b/src/backends/x11/standalone/x11_standalone_backend.cpp index 86e837f046..bcbaddbbd7 100644 --- a/src/backends/x11/standalone/x11_standalone_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_backend.cpp @@ -45,11 +45,7 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include diff --git a/src/backends/x11/standalone/x11_standalone_effects_keyboard_interception_filter.cpp b/src/backends/x11/standalone/x11_standalone_effects_keyboard_interception_filter.cpp index 9211fef877..6cf824f002 100644 --- a/src/backends/x11/standalone/x11_standalone_effects_keyboard_interception_filter.cpp +++ b/src/backends/x11/standalone/x11_standalone_effects_keyboard_interception_filter.cpp @@ -10,11 +10,7 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#else #include -#endif namespace KWin { diff --git a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp index 15e2097029..b48f4ef74b 100644 --- a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp @@ -20,9 +20,6 @@ #include "x11_standalone_overlaywindow.h" #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#endif #include namespace KWin @@ -97,17 +94,6 @@ void EglBackend::init() EGLContext shareContext = EGL_NO_CONTEXT; if (qtShareContext) { qDebug(KWIN_X11STANDALONE) << "Global share context format:" << qtShareContext->format(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - const QVariant nativeHandle = qtShareContext->nativeHandle(); - if (!nativeHandle.canConvert()) { - setFailed(QStringLiteral("Invalid QOpenGLContext::globalShareContext()")); - return; - } else { - QEGLNativeContext handle = qvariant_cast(nativeHandle); - shareContext = handle.context(); - shareDisplay = handle.display(); - } -#else const auto nativeHandle = qtShareContext->nativeInterface(); if (nativeHandle) { shareContext = nativeHandle->nativeContext(); @@ -116,7 +102,6 @@ void EglBackend::init() setFailed(QStringLiteral("Invalid QOpenGLContext::globalShareContext()")); return; } -#endif } if (shareContext == EGL_NO_CONTEXT) { setFailed(QStringLiteral("QOpenGLContext::globalShareContext() is required")); diff --git a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp index 163731c2bd..bfa5589aec 100644 --- a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp @@ -39,14 +39,7 @@ // Qt #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#endif // system #include @@ -350,16 +343,6 @@ bool GlxBackend::initRenderingContext() GLXContext globalShareContext = nullptr; if (qtGlobalShareContext) { qDebug(KWIN_X11STANDALONE) << "Global share context format:" << qtGlobalShareContext->format(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - const QVariant nativeHandle = qtGlobalShareContext->nativeHandle(); - if (!nativeHandle.canConvert()) { - qCDebug(KWIN_X11STANDALONE) << "Invalid QOpenGLContext::globalShareContext()"; - return false; - } else { - QGLXNativeContext handle = qvariant_cast(nativeHandle); - globalShareContext = handle.context(); - } -#else const auto nativeHandle = qtGlobalShareContext->nativeInterface(); if (nativeHandle) { globalShareContext = nativeHandle->nativeContext(); @@ -367,7 +350,6 @@ bool GlxBackend::initRenderingContext() qCDebug(KWIN_X11STANDALONE) << "Invalid QOpenGLContext::globalShareContext()"; return false; } -#endif } if (!globalShareContext) { qCWarning(KWIN_X11STANDALONE) << "QOpenGLContext::globalShareContext() is required"; diff --git a/src/backends/x11/standalone/x11_standalone_omlsynccontrolvsyncmonitor.cpp b/src/backends/x11/standalone/x11_standalone_omlsynccontrolvsyncmonitor.cpp index f2cc54aaca..f27ba1c751 100644 --- a/src/backends/x11/standalone/x11_standalone_omlsynccontrolvsyncmonitor.cpp +++ b/src/backends/x11/standalone/x11_standalone_omlsynccontrolvsyncmonitor.cpp @@ -8,11 +8,7 @@ #include "x11_standalone_glxconvenience.h" #include "x11_standalone_logging.h" -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif namespace KWin { diff --git a/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.cpp b/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.cpp index 9e247b0678..c2b7ce8940 100644 --- a/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.cpp +++ b/src/backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.cpp @@ -8,11 +8,7 @@ #include "x11_standalone_glxconvenience.h" #include "x11_standalone_logging.h" -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif namespace KWin { diff --git a/src/composite.cpp b/src/composite.cpp index eefc8a7a2b..ca2d389965 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -325,11 +325,7 @@ bool Compositor::setupStart() if (!Workspace::self() && m_backend && m_backend->compositingType() == QPainterCompositing) { // Force Software QtQuick on first startup with QPainter. -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); -#else QQuickWindow::setGraphicsApi(QSGRendererInterface::Software); -#endif } Q_EMIT sceneCreated(); diff --git a/src/effectloader.cpp b/src/effectloader.cpp index 7f5aa37ab1..ed95c4cf88 100644 --- a/src/effectloader.cpp +++ b/src/effectloader.cpp @@ -163,11 +163,7 @@ void ScriptedEffectLoader::queryAndLoadAll() m_queryConnection = QMetaObject::Connection(); }, Qt::QueuedConnection); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - watcher->setFuture(QtConcurrent::run(this, &ScriptedEffectLoader::findAllEffects)); -#else watcher->setFuture(QtConcurrent::run(&ScriptedEffectLoader::findAllEffects, this)); -#endif } QList ScriptedEffectLoader::findAllEffects() const diff --git a/src/effects/mouseclick/mouseclick.cpp b/src/effects/mouseclick/mouseclick.cpp index 05fabb1e08..603dd5c70d 100644 --- a/src/effects/mouseclick/mouseclick.cpp +++ b/src/effects/mouseclick/mouseclick.cpp @@ -331,18 +331,6 @@ bool MouseClickEffect::tabletToolEvent(QTabletEvent *event) auto &tabletEvent = m_tabletTools[event->uniqueId()]; if (!tabletEvent.m_color.isValid()) { switch (event->pointerType()) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - case QTabletEvent::UnknownPointer: - case QTabletEvent::Pen: - tabletEvent.m_color = MouseClickConfig::color1(); - break; - case QTabletEvent::Eraser: - tabletEvent.m_color = MouseClickConfig::color2(); - break; - case QTabletEvent::Cursor: - tabletEvent.m_color = MouseClickConfig::color3(); - break; -#else case QPointingDevice::PointerType::Unknown: case QPointingDevice::PointerType::Generic: case QPointingDevice::PointerType::Finger: @@ -355,7 +343,6 @@ bool MouseClickEffect::tabletToolEvent(QTabletEvent *event) case QPointingDevice::PointerType::Cursor: tabletEvent.m_color = MouseClickConfig::color3(); break; -#endif } } switch (event->type()) { diff --git a/src/effects/private/expolayout.cpp b/src/effects/private/expolayout.cpp index 55e87d27dc..b0c3704368 100644 --- a/src/effects/private/expolayout.cpp +++ b/src/effects/private/expolayout.cpp @@ -314,20 +314,12 @@ void ExpoLayout::removeCell(ExpoCell *cell) polish(); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -void ExpoLayout::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) -#else void ExpoLayout::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) -#endif { if (newGeometry.size() != oldGeometry.size()) { polish(); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QQuickItem::geometryChanged(newGeometry, oldGeometry); -#else QQuickItem::geometryChange(newGeometry, oldGeometry); -#endif } static int distance(const QPoint &a, const QPoint &b) diff --git a/src/effects/private/expolayout.h b/src/effects/private/expolayout.h index 1fb7af3b2a..895aff7099 100644 --- a/src/effects/private/expolayout.h +++ b/src/effects/private/expolayout.h @@ -50,11 +50,7 @@ public: Q_INVOKABLE void forceLayout(); protected: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; -#else void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; -#endif void updatePolish() override; Q_SIGNALS: diff --git a/src/helpers/killer/CMakeLists.txt b/src/helpers/killer/CMakeLists.txt index 182788708d..bca6afebee 100644 --- a/src/helpers/killer/CMakeLists.txt +++ b/src/helpers/killer/CMakeLists.txt @@ -8,12 +8,8 @@ target_link_libraries(kwin_killer_helper KF6::AuthCore KF6::I18n KF6::WidgetsAddons + Qt::GuiPrivate Qt::Widgets ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(kwin_killer_helper Qt::X11Extras) -else() - target_link_libraries(kwin_killer_helper Qt::GuiPrivate) -endif() install(TARGETS kwin_killer_helper DESTINATION ${KDE_INSTALL_LIBEXECDIR}) diff --git a/src/helpers/killer/killer.cpp b/src/helpers/killer/killer.cpp index 9f1a58d93a..ed103997a5 100644 --- a/src/helpers/killer/killer.cpp +++ b/src/helpers/killer/killer.cpp @@ -12,11 +12,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include #include diff --git a/src/input_event.cpp b/src/input_event.cpp index 65fa7168fb..1e32ded3da 100644 --- a/src/input_event.cpp +++ b/src/input_event.cpp @@ -64,7 +64,6 @@ SwitchEvent::SwitchEvent(State state, std::chrono::microseconds timestamp, Input { } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) TabletEvent::TabletEvent(Type t, const QPointingDevice *dev, const QPointF &pos, const QPointF &globalPos, qreal pressure, float xTilt, float yTilt, float tangentialPressure, qreal rotation, float z, @@ -73,16 +72,5 @@ TabletEvent::TabletEvent(Type t, const QPointingDevice *dev, const QPointF &pos, , m_id(tabletId) { } -#else -TabletEvent::TabletEvent(Type t, const QPointF &pos, const QPointF &globalPos, - int device, int pointerType, qreal pressure, int xTilt, int yTilt, - qreal tangentialPressure, qreal rotation, int z, - Qt::KeyboardModifiers keyState, qint64 uniqueID, - Qt::MouseButton button, Qt::MouseButtons buttons, const TabletToolId &tabletId) - : QTabletEvent(t, pos, globalPos, device, pointerType, pressure, xTilt, yTilt, tangentialPressure, rotation, z, keyState, uniqueID, button, buttons) - , m_id(tabletId) -{ -} -#endif } diff --git a/src/input_event.h b/src/input_event.h index 9981eeac9b..5389879600 100644 --- a/src/input_event.h +++ b/src/input_event.h @@ -210,18 +210,10 @@ public: class TabletEvent : public QTabletEvent { public: -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) TabletEvent(Type t, const QPointingDevice *dev, const QPointF &pos, const QPointF &globalPos, qreal pressure, float xTilt, float yTilt, float tangentialPressure, qreal rotation, float z, Qt::KeyboardModifiers keyState, Qt::MouseButton button, Qt::MouseButtons buttons, const TabletToolId &tabletId); -#else - TabletEvent(Type t, const QPointF &pos, const QPointF &globalPos, - int device, int pointerType, qreal pressure, int xTilt, int yTilt, - qreal tangentialPressure, qreal rotation, int z, - Qt::KeyboardModifiers keyState, qint64 uniqueID, - Qt::MouseButton button, Qt::MouseButtons buttons, const TabletToolId &tabletId); -#endif const TabletToolId &tabletId() const { diff --git a/src/libkwineffects/CMakeLists.txt b/src/libkwineffects/CMakeLists.txt index a49cde8534..02d90c8f93 100644 --- a/src/libkwineffects/CMakeLists.txt +++ b/src/libkwineffects/CMakeLists.txt @@ -42,13 +42,11 @@ target_link_libraries(kwineffects KF6::WindowSystem XCB::XCB PRIVATE + Qt::GuiPrivate Qt::Quick KF6::I18n kwinglutils ) -if (QT_MAJOR_VERSION EQUAL "6") - target_link_libraries(kwineffects PRIVATE Qt::GuiPrivate) -endif() set_target_properties(kwineffects PROPERTIES VERSION ${KWINEFFECTS_VERSION} SOVERSION ${KWINEFFECTS_SOVERSION} diff --git a/src/libkwineffects/kwinoffscreenquickview.cpp b/src/libkwineffects/kwinoffscreenquickview.cpp index ef9ab825fd..36b2c3ed01 100644 --- a/src/libkwineffects/kwinoffscreenquickview.cpp +++ b/src/libkwineffects/kwinoffscreenquickview.cpp @@ -26,12 +26,10 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include #include #include #include // for QMutableEventPoint -#endif namespace KWin { @@ -83,14 +81,8 @@ public: bool m_visible = true; bool m_automaticRepaint = true; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QList touchPoints; - Qt::TouchPointStates touchState; - QTouchDevice *touchDevice; -#else QList touchPoints; QPointingDevice *touchDevice; -#endif ulong lastMousePressTime = 0; Qt::MouseButton lastMousePressButton = Qt::NoButton; @@ -147,11 +139,7 @@ OffscreenQuickView::OffscreenQuickView(QObject *parent, QWindow *renderWindow, E if (!usingGl) { qCDebug(LIBKWINEFFECTS) << "QtQuick Software rendering mode detected"; d->m_useBlit = true; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - d->m_renderControl->initialize(nullptr); -#else d->m_renderControl->initialize(); -#endif } else { QSurfaceFormat format; format.setOption(QSurfaceFormat::ResetNotification); @@ -170,12 +158,8 @@ OffscreenQuickView::OffscreenQuickView(QObject *parent, QWindow *renderWindow, E d->m_offscreenSurface->create(); d->m_glcontext->makeCurrent(d->m_offscreenSurface.get()); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - d->m_renderControl->initialize(d->m_glcontext.get()); -#else d->m_view->setGraphicsDevice(QQuickGraphicsDevice::fromOpenGLContext(d->m_glcontext.get())); d->m_renderControl->initialize(); -#endif d->m_glcontext->doneCurrent(); // On Wayland, contexts are implicitly shared and QOpenGLContext::globalShareContext() is null. @@ -201,14 +185,7 @@ OffscreenQuickView::OffscreenQuickView(QObject *parent, QWindow *renderWindow, E connect(d->m_renderControl.get(), &QQuickRenderControl::renderRequested, this, &OffscreenQuickView::handleRenderRequested); connect(d->m_renderControl.get(), &QQuickRenderControl::sceneChanged, this, &OffscreenQuickView::handleSceneChanged); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - d->touchDevice = new QTouchDevice{}; - d->touchDevice->setCapabilities(QTouchDevice::Position); - d->touchDevice->setType(QTouchDevice::TouchScreen); - d->touchDevice->setMaximumTouchPoints(10); -#else d->touchDevice = new QPointingDevice({}, {}, QInputDevice::DeviceType::TouchScreen, {}, QInputDevice::Capability::Position, 10, {}); -#endif } OffscreenQuickView::~OffscreenQuickView() @@ -283,37 +260,21 @@ void OffscreenQuickView::update() return; } } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - d->m_view->setRenderTarget(d->m_fbo.get()); -#else d->m_view->setRenderTarget(QQuickRenderTarget::fromOpenGLTexture(d->m_fbo->texture(), d->m_fbo->size())); -#endif } d->m_renderControl->polishItems(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) d->m_renderControl->beginFrame(); -#endif d->m_renderControl->sync(); d->m_renderControl->render(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) d->m_renderControl->endFrame(); -#endif if (usingGl) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - d->m_view->resetOpenGLState(); -#else QQuickOpenGLUtils::resetOpenGLState(); -#endif } if (d->m_useBlit) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - d->m_image = d->m_renderControl->grab(); -#else d->m_image = d->m_view->grabWindow(); -#endif } if (usingGl) { @@ -389,11 +350,7 @@ bool OffscreenQuickView::forwardTouchDown(qint32 id, const QPointF &pos, std::ch { d->updateTouchState(Qt::TouchPointPressed, id, pos); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QTouchEvent event(QEvent::TouchBegin, d->touchDevice, Qt::NoModifier, d->touchState, d->touchPoints); -#else QTouchEvent event(QEvent::TouchBegin, d->touchDevice, Qt::NoModifier, d->touchPoints); -#endif event.setTimestamp(std::chrono::duration_cast(time).count()); QCoreApplication::sendEvent(d->m_view.get(), &event); @@ -404,11 +361,7 @@ bool OffscreenQuickView::forwardTouchMotion(qint32 id, const QPointF &pos, std:: { d->updateTouchState(Qt::TouchPointMoved, id, pos); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QTouchEvent event(QEvent::TouchUpdate, d->touchDevice, Qt::NoModifier, d->touchState, d->touchPoints); -#else QTouchEvent event(QEvent::TouchUpdate, d->touchDevice, Qt::NoModifier, d->touchPoints); -#endif event.setTimestamp(std::chrono::duration_cast(time).count()); QCoreApplication::sendEvent(d->m_view.get(), &event); @@ -419,11 +372,7 @@ bool OffscreenQuickView::forwardTouchUp(qint32 id, std::chrono::microseconds tim { d->updateTouchState(Qt::TouchPointReleased, id, QPointF{}); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QTouchEvent event(QEvent::TouchEnd, d->touchDevice, Qt::NoModifier, d->touchState, d->touchPoints); -#else QTouchEvent event(QEvent::TouchEnd, d->touchDevice, Qt::NoModifier, d->touchPoints); -#endif event.setTimestamp(std::chrono::duration_cast(time).count()); QCoreApplication::sendEvent(d->m_view.get(), &event); @@ -543,11 +492,7 @@ void OffscreenQuickView::Private::updateTouchState(Qt::TouchPointState state, qi if (point.state() == Qt::TouchPointReleased) { return true; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - point.setState(Qt::TouchPointStationary); -#else QMutableEventPoint::setState(point, QEventPoint::Stationary); -#endif return false; }), touchPoints.end()); @@ -571,19 +516,11 @@ void OffscreenQuickView::Private::updateTouchState(Qt::TouchPointState state, qi } QTouchEvent::TouchPoint point; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - point.setState(Qt::TouchPointPressed); - point.setId(id + idOffset); - point.setScreenPos(pos); - point.setScenePos(m_view->mapFromGlobal(pos.toPoint())); - point.setPos(m_view->mapFromGlobal(pos.toPoint())); -#else QMutableEventPoint::setState(point, QEventPoint::Pressed); QMutableEventPoint::setId(point, id + idOffset); QMutableEventPoint::setGlobalPosition(point, pos); QMutableEventPoint::setScenePosition(point, m_view->mapFromGlobal(pos.toPoint())); QMutableEventPoint::setPosition(point, m_view->mapFromGlobal(pos.toPoint())); -#endif touchPoints.append(point); } break; @@ -593,21 +530,11 @@ void OffscreenQuickView::Private::updateTouchState(Qt::TouchPointState state, qi } auto &point = *changed; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - point.setLastPos(point.pos()); - point.setLastScenePos(point.scenePos()); - point.setLastScreenPos(point.screenPos()); - point.setState(Qt::TouchPointMoved); - point.setScenePos(m_view->mapFromGlobal(pos.toPoint())); - point.setPos(m_view->mapFromGlobal(pos.toPoint())); - point.setScreenPos(pos); -#else QMutableEventPoint::setGlobalLastPosition(point, point.globalPosition()); QMutableEventPoint::setState(point, QEventPoint::Updated); QMutableEventPoint::setScenePosition(point, m_view->mapFromGlobal(pos.toPoint())); QMutableEventPoint::setPosition(point, m_view->mapFromGlobal(pos.toPoint())); QMutableEventPoint::setGlobalPosition(point, pos); -#endif } break; case Qt::TouchPointReleased: { if (changed == touchPoints.end()) { @@ -615,26 +542,12 @@ void OffscreenQuickView::Private::updateTouchState(Qt::TouchPointState state, qi } auto &point = *changed; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - point.setLastPos(point.pos()); - point.setLastScreenPos(point.screenPos()); - point.setState(Qt::TouchPointReleased); -#else QMutableEventPoint::setGlobalLastPosition(point, point.globalPosition()); QMutableEventPoint::setState(point, QEventPoint::Released); -#endif } break; default: break; } - - // The touch state value is used in QTouchEvent and includes all the states - // that the current touch points are in. -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - touchState = std::accumulate(touchPoints.begin(), touchPoints.end(), Qt::TouchPointStates{}, [](auto init, const auto &point) { - return init | point.state(); - }); -#endif } OffscreenQuickScene::OffscreenQuickScene(QObject *parent) diff --git a/src/main.cpp b/src/main.cpp index cece92c3b7..4960302389 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,12 +48,7 @@ #include #include #include - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include @@ -596,11 +591,7 @@ void Application::updateX11Time(xcb_generic_event_t *event) setX11Time(time); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -bool XcbEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long int *result) -#else bool XcbEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) -#endif { if (eventType == "xcb_generic_event_t") { return kwinApp()->dispatchEvent(static_cast(message)); diff --git a/src/main.h b/src/main.h index 5d36810d61..c0b03c6e36 100644 --- a/src/main.h +++ b/src/main.h @@ -46,11 +46,7 @@ class Window; class XcbEventFilter : public QAbstractNativeEventFilter { public: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; -#else bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; -#endif }; class X11EventFilterContainer : public QObject diff --git a/src/main_x11.cpp b/src/main_x11.cpp index 42442f032d..74b162cbec 100644 --- a/src/main_x11.cpp +++ b/src/main_x11.cpp @@ -40,11 +40,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include // system diff --git a/src/plugins/kdecorations/aurorae/src/aurorae.cpp b/src/plugins/kdecorations/aurorae/src/aurorae.cpp index f504e098eb..e5c4f296e0 100644 --- a/src/plugins/kdecorations/aurorae/src/aurorae.cpp +++ b/src/plugins/kdecorations/aurorae/src/aurorae.cpp @@ -769,14 +769,6 @@ void ConfigurationModule::initQml() } KPluginMetaData metaData(packageRoot + QLatin1String("/metadata.json")); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (!metaData.isValid()) { - metaData = KPluginMetaData::fromDesktopFile(packageRoot + QLatin1String("/metadata.desktop")); - if (metaData.isValid()) { - qWarning("metadata.desktop format is obsolete. Please convert %s to JSON metadata", qPrintable(metaData.fileName())); - } - } -#endif if (!metaData.isValid()) { return; } diff --git a/src/plugins/qpa/CMakeLists.txt b/src/plugins/qpa/CMakeLists.txt index 3655e587b0..60672a8c9a 100644 --- a/src/plugins/qpa/CMakeLists.txt +++ b/src/plugins/qpa/CMakeLists.txt @@ -28,11 +28,3 @@ target_link_libraries(KWinQpaPlugin PRIVATE Fontconfig::Fontconfig kwin ) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(KWinQpaPlugin PRIVATE - Qt::FontDatabaseSupportPrivate - Qt::ThemeSupportPrivate - Qt::EventDispatcherSupportPrivate - Qt::ServiceSupportPrivate - ) -endif() diff --git a/src/plugins/qpa/integration.cpp b/src/plugins/qpa/integration.cpp index 97bfb0b8c4..76db7e5838 100644 --- a/src/plugins/qpa/integration.cpp +++ b/src/plugins/qpa/integration.cpp @@ -28,16 +28,10 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#include -#include -#else #include #include #include #include -#endif namespace KWin { diff --git a/src/plugins/qpa/integration.h b/src/plugins/qpa/integration.h index c9981e052c..249f55216f 100644 --- a/src/plugins/qpa/integration.h +++ b/src/plugins/qpa/integration.h @@ -12,11 +12,7 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#else #include -#endif #include namespace KWin diff --git a/src/scripting/genericscriptedconfig.cpp b/src/scripting/genericscriptedconfig.cpp index 41711f28f9..8aa7d1d3bf 100644 --- a/src/scripting/genericscriptedconfig.cpp +++ b/src/scripting/genericscriptedconfig.cpp @@ -71,14 +71,6 @@ void GenericScriptedConfig::createUi() } KPluginMetaData metaData(packageRoot + QLatin1String("/metadata.json")); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (!metaData.isValid()) { - metaData = KPluginMetaData::fromDesktopFile(packageRoot + QLatin1String("/metadata.desktop")); - if (metaData.isValid()) { - qWarning("metadata.desktop format is obsolete. Please convert %s to JSON metadata", qPrintable(metaData.fileName())); - } - } -#endif if (!metaData.isValid()) { layout->addWidget(new QLabel(i18nc("Required file does not exist", "%1 does not contain a valid metadata.json file", qPrintable(packageRoot)))); return; diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index 139bb988c1..3b2f6ec39e 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -170,11 +170,7 @@ void KWin::Script::run() m_starting = true; QFutureWatcher *watcher = new QFutureWatcher(this); connect(watcher, &QFutureWatcherBase::finished, this, &Script::slotScriptLoadedFromFile); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - watcher->setFuture(QtConcurrent::run(this, &KWin::Script::loadScriptFromFile, fileName())); -#else watcher->setFuture(QtConcurrent::run(&KWin::Script::loadScriptFromFile, this, fileName())); -#endif } QByteArray KWin::Script::loadScriptFromFile(const QString &fileName) diff --git a/src/scripting/windowthumbnailitem.cpp b/src/scripting/windowthumbnailitem.cpp index bc8e571ed2..ac25e4ab05 100644 --- a/src/scripting/windowthumbnailitem.cpp +++ b/src/scripting/windowthumbnailitem.cpp @@ -58,16 +58,9 @@ void ThumbnailTextureProvider::setTexture(const std::shared_ptr &nati if (m_nativeTexture != nativeTexture) { const GLuint textureId = nativeTexture->texture(); m_nativeTexture = nativeTexture; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - m_texture.reset(m_window->createTextureFromNativeObject(QQuickWindow::NativeObjectTexture, - &textureId, 0, - nativeTexture->size(), - QQuickWindow::TextureHasAlphaChannel)); -#else m_texture.reset(QNativeInterface::QSGOpenGLTexture::fromNative(textureId, m_window, nativeTexture->size(), QQuickWindow::TextureHasAlphaChannel)); -#endif m_texture->setFiltering(QSGTexture::Linear); m_texture->setHorizontalWrapMode(QSGTexture::ClampToEdge); m_texture->setVerticalWrapMode(QSGTexture::ClampToEdge); diff --git a/src/scripting/workspace_wrapper.cpp b/src/scripting/workspace_wrapper.cpp index 4362d831cf..74e862019c 100644 --- a/src/scripting/workspace_wrapper.cpp +++ b/src/scripting/workspace_wrapper.cpp @@ -377,20 +377,12 @@ QQmlListProperty DeclarativeScriptWorkspaceWrapper::clients() return QQmlListProperty(this, nullptr, &DeclarativeScriptWorkspaceWrapper::countClientList, &DeclarativeScriptWorkspaceWrapper::atClientList); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -int DeclarativeScriptWorkspaceWrapper::countClientList(QQmlListProperty *clients) -#else qsizetype DeclarativeScriptWorkspaceWrapper::countClientList(QQmlListProperty *clients) -#endif { return workspace()->allClientList().size(); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -KWin::Window *DeclarativeScriptWorkspaceWrapper::atClientList(QQmlListProperty *clients, int index) -#else KWin::Window *DeclarativeScriptWorkspaceWrapper::atClientList(QQmlListProperty *clients, qsizetype index) -#endif { return workspace()->allClientList().at(index); } diff --git a/src/scripting/workspace_wrapper.h b/src/scripting/workspace_wrapper.h index 20aa030686..4606eaccb7 100644 --- a/src/scripting/workspace_wrapper.h +++ b/src/scripting/workspace_wrapper.h @@ -353,13 +353,8 @@ class DeclarativeScriptWorkspaceWrapper : public WorkspaceWrapper Q_PROPERTY(QQmlListProperty clients READ clients) public: QQmlListProperty clients(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - static int countClientList(QQmlListProperty *clients); - static KWin::Window *atClientList(QQmlListProperty *clients, int index); -#else static qsizetype countClientList(QQmlListProperty *clients); static KWin::Window *atClientList(QQmlListProperty *clients, qsizetype index); -#endif explicit DeclarativeScriptWorkspaceWrapper(QObject *parent = nullptr); }; diff --git a/src/tablet_input.cpp b/src/tablet_input.cpp index 55aaf2b4cb..e29da56eee 100644 --- a/src/tablet_input.cpp +++ b/src/tablet_input.cpp @@ -74,7 +74,6 @@ void TabletInputRedirection::tabletToolEvent(KWin::InputRedirection::TabletEvent const auto button = m_tipDown ? Qt::LeftButton : Qt::NoButton; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // TODO: Not correct, but it should work fine. In long term, we need to stop using QTabletEvent. const QPointingDevice *dev = QPointingDevice::primaryPointingDevice(); TabletEvent ev(t, dev, pos, pos, pressure, @@ -83,14 +82,6 @@ void TabletInputRedirection::tabletToolEvent(KWin::InputRedirection::TabletEvent rotation, 0, // z Qt::NoModifier, button, button, tabletToolId); -#else - TabletEvent ev(t, pos, pos, QTabletEvent::Stylus, QTabletEvent::Pen, pressure, - xTilt, yTilt, - 0, // tangentialPressure - rotation, - 0, // z - Qt::NoModifier, tabletToolId.m_uniqueId, button, button, tabletToolId); -#endif ev.setTimestamp(std::chrono::duration_cast(time).count()); input()->processSpies(std::bind(&InputEventSpy::tabletToolEvent, std::placeholders::_1, &ev)); diff --git a/src/tiles/tile.cpp b/src/tiles/tile.cpp index 8ab0520e4a..6082770e1b 100644 --- a/src/tiles/tile.cpp +++ b/src/tiles/tile.cpp @@ -304,11 +304,7 @@ void Tile::insertChild(int position, Tile *item) const bool wasEmpty = m_children.isEmpty(); item->setParent(this); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - m_children.insert(std::clamp(position, 0, m_children.length()), item); -#else m_children.insert(std::clamp(position, 0, m_children.length()), item); -#endif if (wasEmpty) { Q_EMIT isLayoutChanged(true); diff --git a/src/useractions.cpp b/src/useractions.cpp index 4f59e4d7cf..2e618d2c67 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -845,20 +845,11 @@ void ShortcutDialog::accept() { QKeySequence seq = shortcut(); if (!seq.isEmpty()) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (seq[0] == Qt::Key_Escape) { -#else if (seq[0] == QKeyCombination(Qt::Key_Escape)) { -#endif reject(); return; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - if (seq[0] == Qt::Key_Space - || (seq[0] & Qt::KeyboardModifierMask) == 0) { -#else if (seq[0] == QKeyCombination(Qt::Key_Space) || seq[0].keyboardModifiers() == Qt::NoModifier) { -#endif // clear m_ui.keySequenceEdit->clear(); QDialog::accept(); diff --git a/src/wayland/autotests/client/CMakeLists.txt b/src/wayland/autotests/client/CMakeLists.txt index 63c6a98193..f92207bad8 100644 --- a/src/wayland/autotests/client/CMakeLists.txt +++ b/src/wayland/autotests/client/CMakeLists.txt @@ -29,15 +29,8 @@ add_executable(testWaylandSeat) set( testWaylandSeat_SRCS test_wayland_seat.cpp ) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(testWaylandSeat_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml - BASENAME pointer-gestures-unstable-v1 - ) -else() - qt6_generate_wayland_protocol_client_sources(testWaylandSeat FILES - ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testWaylandSeat FILES + ${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml) target_sources(testWaylandSeat PRIVATE ${testWaylandSeat_SRCS}) target_link_libraries( testWaylandSeat Qt::Test Qt::Gui KF6::WaylandClient kwin Wayland::Client Wayland::Server) add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat) diff --git a/src/wayland/autotests/server/CMakeLists.txt b/src/wayland/autotests/server/CMakeLists.txt index 8ee75df271..52a73210f4 100644 --- a/src/wayland/autotests/server/CMakeLists.txt +++ b/src/wayland/autotests/server/CMakeLists.txt @@ -32,15 +32,8 @@ ecm_mark_as_test(testNoXdgRuntimeDir) # Test Tablet Interface ######################################################## add_executable(testTabletInterface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(TABLET_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml - BASENAME tablet-unstable-v2 - ) -else() - qt6_generate_wayland_protocol_client_sources(testTabletInterface FILES - ${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testTabletInterface FILES + ${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml) target_sources(testTabletInterface PRIVATE test_tablet_interface.cpp ${TABLET_SRCS}) target_link_libraries( testTabletInterface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testTabletInterface COMMAND testTabletInterface) @@ -50,15 +43,8 @@ ecm_mark_as_test(testTabletInterface) # Test DataControlInterface ######################################################## add_executable(testDataControlInterface test_datacontrol_interface.cpp ${DATACONTROL_SRCS}) -if (QT_MAJOR_VERSION EQUAL "5") -ecm_add_qtwayland_client_protocol(DATACONTROL_SRCS - PROTOCOL ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-data-control-unstable-v1.xml - BASENAME wlr-data-control-unstable-v1 -) -else() - qt6_generate_wayland_protocol_client_sources(testDataControlInterface FILES - ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-data-control-unstable-v1.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testDataControlInterface FILES + ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-data-control-unstable-v1.xml) target_sources(testDataControlInterface PRIVATE test_datacontrol_interface.cpp ${DATACONTROL_SRCS}) target_link_libraries( testDataControlInterface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testDataControlInterface COMMAND testDataControlInterface) @@ -68,15 +54,8 @@ ecm_mark_as_test(testDataControlInterface) # Test Keyboard Shortcuts Inhibitor Interface ######################################################## add_executable(testKeyboardShortcutsInhibitorInterface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(KEYBOARD_SHORTCUTS_INHIBITOR_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml - BASENAME keyboard-shortcuts-inhibit-unstable-v1 - ) -else() - qt6_generate_wayland_protocol_client_sources(testKeyboardShortcutsInhibitorInterface FILES - ${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testKeyboardShortcutsInhibitorInterface FILES + ${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml) target_sources(testKeyboardShortcutsInhibitorInterface PRIVATE test_keyboard_shortcuts_inhibitor_interface.cpp ${KEYBOARD_SHORTCUTS_INHIBITOR_SRCS}) target_link_libraries(testKeyboardShortcutsInhibitorInterface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testKeyboardShortcutsInhibitorInterface COMMAND testKeyboardShortcutsInhibitorInterface) @@ -86,15 +65,8 @@ ecm_mark_as_test(testKeyboardShortcutsInhibitorInterface) # Test Viewporter Interface ######################################################## add_executable(testViewporterInterface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(VIEWPORTER_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml - BASENAME viewporter - ) -else() - qt6_generate_wayland_protocol_client_sources(testViewporterInterface FILES - ${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testViewporterInterface FILES + ${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml) target_sources(testViewporterInterface PRIVATE test_viewporter_interface.cpp ${VIEWPORTER_SRCS}) target_link_libraries(testViewporterInterface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testViewporterInterface COMMAND testViewporterInterface) @@ -104,15 +76,8 @@ ecm_mark_as_test(testViewporterInterface) # Test ScreencastV1Interface ######################################################## add_executable(testScreencastV1Interface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(SCREENCAST_SRCS - PROTOCOL PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml - BASENAME zkde-screencast-unstable-v1 - ) -else() - qt6_generate_wayland_protocol_client_sources(testScreencastV1Interface FILES - ${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testScreencastV1Interface FILES + ${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml) target_sources(testScreencastV1Interface PRIVATE test_screencast.cpp ${SCREENCAST_SRCS}) target_link_libraries(testScreencastV1Interface Qt::Test kwin Wayland::Client KF6::WaylandClient) add_test(NAME kwayland-testScreencastV1Interface COMMAND testScreencastV1Interface) @@ -122,18 +87,11 @@ ecm_mark_as_test(testScreencastV1Interface) # Test InputMethod Interface ######################################################## add_executable(testInputMethodInterface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(INPUTMETHOD_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml - BASENAME input-method-unstable-v1 - ) -else() - qt6_generate_wayland_protocol_client_sources(testInputMethodInterface - NO_INCLUDE_CORE_ONLY - FILES - ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml - ) -endif() +qt6_generate_wayland_protocol_client_sources(testInputMethodInterface + NO_INCLUDE_CORE_ONLY + FILES + ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml +) target_sources(testInputMethodInterface PRIVATE test_inputmethod_interface.cpp ../../tests/fakeoutput.cpp ${INPUTMETHOD_SRCS}) target_link_libraries(testInputMethodInterface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testInputMethodInterface COMMAND testInputMethodInterface) @@ -143,21 +101,10 @@ ecm_mark_as_test(testInputMethodInterface) # Test LayerShellV1 Interface ######################################################## add_executable(testLayerShellV1Interface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(LAYERSHELLV1_SRCS - PROTOCOL ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml - BASENAME wlr-layer-shell-unstable-v1 - ) - ecm_add_qtwayland_client_protocol(LAYERSHELLV1_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml - BASENAME xdg-shell - ) -else() - qt6_generate_wayland_protocol_client_sources(testLayerShellV1Interface FILES - ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml - ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml - ) -endif() +qt6_generate_wayland_protocol_client_sources(testLayerShellV1Interface FILES + ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml + ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml +) target_sources(testLayerShellV1Interface PRIVATE test_layershellv1_interface.cpp ${LAYERSHELLV1_SRCS}) target_link_libraries(testLayerShellV1Interface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testLayerShellV1Interface COMMAND testLayerShellV1Interface) @@ -168,15 +115,8 @@ ecm_mark_as_test(testLayerShellV1Interface) # Test TextInputV3 Interface ######################################################## add_executable(testTextInputV3Interface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(TEXTINPUTV3_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml - BASENAME text-input-unstable-v3 - ) -else() - qt6_generate_wayland_protocol_client_sources(testTextInputV3Interface FILES - ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testTextInputV3Interface FILES + ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml) target_sources(testTextInputV3Interface PRIVATE test_textinputv3_interface.cpp ${TEXTINPUTV3_SRCS}) target_link_libraries(testTextInputV3Interface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testTextInputV3Interface COMMAND testTextInputV3Interface) @@ -186,15 +126,8 @@ ecm_mark_as_test(testTextInputV3Interface) # Test TextInputV1 Interface ######################################################## add_executable(testTextInputV1Interface) -if (QT_MAJOR_VERSION EQUAL "5") - ecm_add_qtwayland_client_protocol(TEXTINPUTV1_SRCS - PROTOCOL ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml - BASENAME text-input-unstable-v1 - ) -else() - qt6_generate_wayland_protocol_client_sources(testTextInputV1Interface FILES - ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml) -endif() +qt6_generate_wayland_protocol_client_sources(testTextInputV1Interface FILES + ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml) target_sources(testTextInputV1Interface PRIVATE test_textinputv1_interface.cpp ${TEXTINPUTV1_SRCS}) target_link_libraries(testTextInputV1Interface Qt::Test kwin KF6::WaylandClient Wayland::Client) add_test(NAME kwayland-testTextInputV1Interface COMMAND testTextInputV1Interface) diff --git a/src/workspace.cpp b/src/workspace.cpp index 17585a1de2..8c07ff8dc3 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -132,11 +132,7 @@ Workspace::Workspace() , m_placementTracker(std::make_unique(this)) { // If KWin was already running it saved its configuration after loosing the selection -> Reread -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QFuture reparseConfigFuture = QtConcurrent::run(options, &Options::reparseConfiguration); -#else QFuture reparseConfigFuture = QtConcurrent::run(&Options::reparseConfiguration, options); -#endif _self = this; diff --git a/src/xkb.cpp b/src/xkb.cpp index 0dc89082ac..229909363d 100644 --- a/src/xkb.cpp +++ b/src/xkb.cpp @@ -17,11 +17,7 @@ // Qt #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#else #include -#endif // xkbcommon #include #include @@ -576,11 +572,6 @@ Qt::Key Xkb::toQtKey(xkb_keysym_t keySym, } else if (qtKey > 0xff && keySym <= 0xff) { // XKB_KEY_mu, XKB_KEY_ydiaeresis go here qtKey = Qt::Key(keySym); -#if QT_VERSION_MAJOR < 6 // since Qt 5 LTS is frozen - } else if (keySym == XKB_KEY_Sys_Req) { - // fixed in QTBUG-92087 - qtKey = Qt::Key_SysReq; -#endif } return qtKey; } diff --git a/src/xwayland/databridge.cpp b/src/xwayland/databridge.cpp index ad38e2d8de..b0de4aea99 100644 --- a/src/xwayland/databridge.cpp +++ b/src/xwayland/databridge.cpp @@ -42,11 +42,7 @@ void DataBridge::init() kwinApp()->installNativeEventFilter(this); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -bool DataBridge::nativeEventFilter(const QByteArray &eventType, void *message, long int *) -#else bool DataBridge::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) -#endif { if (eventType == "xcb_generic_event_t") { xcb_generic_event_t *event = static_cast(message); diff --git a/src/xwayland/databridge.h b/src/xwayland/databridge.h index c63f6e2fff..b43636121d 100644 --- a/src/xwayland/databridge.h +++ b/src/xwayland/databridge.h @@ -51,11 +51,7 @@ public: return m_dnd; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - bool nativeEventFilter(const QByteArray &eventType, void *message, long int *result) override; -#else bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; -#endif private: void init(); diff --git a/src/xwayland/xwayland.cpp b/src/xwayland/xwayland.cpp index 7886034de8..cfe79fe4a7 100644 --- a/src/xwayland/xwayland.cpp +++ b/src/xwayland/xwayland.cpp @@ -242,11 +242,7 @@ void Xwayland::dispatchEvents(DispatchEventsMode mode) auto pollEventFunc = mode == DispatchEventsMode::Poll ? xcb_poll_for_event : xcb_poll_for_queued_event; while (xcb_generic_event_t *event = pollEventFunc(connection)) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - long result = 0; -#else qintptr result = 0; -#endif QAbstractEventDispatcher *dispatcher = QCoreApplication::eventDispatcher(); dispatcher->filterNativeEvent(QByteArrayLiteral("xcb_generic_event_t"), event, &result); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0e716663f2..1bcc8f680e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,3 @@ -if (QT_MAJOR_VERSION EQUAL "5") - find_package(Qt6 REQUIRED COMPONENTS WaylandClient) -endif() - if (XCB_ICCCM_FOUND) set(normalhintsbasesizetest_SRCS normalhintsbasesizetest.cpp) add_executable(normalhintsbasesizetest ${normalhintsbasesizetest_SRCS}) @@ -11,21 +7,11 @@ endif() # next target set(screenedgeshowtest_SRCS screenedgeshowtest.cpp) add_executable(screenedgeshowtest ${screenedgeshowtest_SRCS}) -target_link_libraries(screenedgeshowtest Qt::Widgets KF6::ConfigCore KF6::WindowSystem KF6::WaylandClient ${XCB_XCB_LIBRARY}) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(screenedgeshowtest Qt::X11Extras) -else() - target_link_libraries(screenedgeshowtest Qt::GuiPrivate) -endif() +target_link_libraries(screenedgeshowtest Qt::GuiPrivate Qt::Widgets KF6::ConfigCore KF6::WindowSystem KF6::WaylandClient ${XCB_XCB_LIBRARY}) target_include_directories(screenedgeshowtest PRIVATE ${CMAKE_SOURCE_DIR}/src) add_executable(x11shadowreader x11shadowreader.cpp) -target_link_libraries(x11shadowreader XCB::XCB Qt::Widgets KF6::ConfigCore KF6::WindowSystem) -if (QT_MAJOR_VERSION EQUAL "5") - target_link_libraries(x11shadowreader Qt::X11Extras) -else() - target_link_libraries(x11shadowreader Qt::GuiPrivate) -endif() +target_link_libraries(x11shadowreader XCB::XCB Qt::GuiPrivate Qt::Widgets KF6::ConfigCore KF6::WindowSystem) target_include_directories(x11shadowreader PRIVATE ${CMAKE_SOURCE_DIR}/src) add_executable(pointerconstraints pointerconstraintstest.cpp) @@ -41,23 +27,5 @@ target_link_libraries(cursorhotspottest Qt::Widgets) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -if (QT_MAJOR_VERSION EQUAL "5") - add_executable(xdgactivationtest-qt5 xdgactivationtest-qt5.cpp) - target_link_libraries(xdgactivationtest-qt5 Qt::Widgets Qt::WaylandClient Qt::WaylandClientPrivate Wayland::Client) - ecm_add_qtwayland_client_protocol(xdgactivationtest-qt5 - PROTOCOL ${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml - BASENAME xdg-activation-v1 - ) - - add_executable(lockscreenoverlaytest lockscreenoverlaytest.cpp) - target_link_libraries(lockscreenoverlaytest Qt::Widgets Qt::WaylandClient Qt::WaylandClientPrivate Wayland::Client KF6::WindowSystem) - ecm_add_qtwayland_client_protocol(lockscreenoverlaytest - PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/kde-lockscreen-overlay-v1.xml - BASENAME kde-lockscreen-overlay-v1 - ) -endif() - -if (TARGET Qt6::Gui) - add_executable(xdgactivationtest-qt6 xdgactivationtest-qt6.cpp) - target_link_libraries(xdgactivationtest-qt6 Qt6::Widgets) -endif() +add_executable(xdgactivationtest-qt6 xdgactivationtest-qt6.cpp) +target_link_libraries(xdgactivationtest-qt6 Qt6::Widgets) diff --git a/tests/screenedgeshowtest.cpp b/tests/screenedgeshowtest.cpp index e42dbbf6d7..40ae6e3c27 100644 --- a/tests/screenedgeshowtest.cpp +++ b/tests/screenedgeshowtest.cpp @@ -16,11 +16,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif #include diff --git a/tests/x11shadowreader.cpp b/tests/x11shadowreader.cpp index 652b4d6db3..70699f9c60 100644 --- a/tests/x11shadowreader.cpp +++ b/tests/x11shadowreader.cpp @@ -12,11 +12,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include -#endif static QVector readShadow(quint32 windowId) { diff --git a/tests/xdgactivationtest-qt5.cpp b/tests/xdgactivationtest-qt5.cpp deleted file mode 100644 index f65ce8b7d8..0000000000 --- a/tests/xdgactivationtest-qt5.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez - SPDX-FileCopyrightText: 2022 Ilya Fedin - - SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -*/ - -#include "qwayland-xdg-activation-v1.h" -#include -#include -#include - -class WaylandXdgActivationTokenV1 : public QObject, public QtWayland::xdg_activation_token_v1 -{ - Q_OBJECT -public: - void xdg_activation_token_v1_done(const QString &token) override - { - Q_EMIT done(token); - } - -Q_SIGNALS: - void done(const QString &token); -}; - -class WaylandXdgActivationV1 : public QWaylandClientExtensionTemplate, public QtWayland::xdg_activation_v1 -{ -public: - WaylandXdgActivationV1() - : QWaylandClientExtensionTemplate(1) - { - // QWaylandClientExtensionTemplate invokes this with a QueuedConnection but we want shortcuts - // to be inhibited immediately. - QMetaObject::invokeMethod(this, "addRegistryListener"); - } - - WaylandXdgActivationTokenV1 *requestXdgActivationToken(wl_seat *seat, struct ::wl_surface *surface, uint32_t serial, const QString &app_id) - { - auto wl = get_activation_token(); - auto provider = new WaylandXdgActivationTokenV1; - provider->init(wl); - if (surface) { - provider->set_surface(surface); - } - - if (!app_id.isEmpty()) { - provider->set_app_id(app_id); - } - - if (seat) { - provider->set_serial(serial, seat); - } - provider->commit(); - return provider; - } -}; - -int main(int argc, char *argv[]) -{ - - QApplication app(argc, argv); - QWidget window1(nullptr, Qt::Window); - window1.setWindowTitle("Window 1"); - window1.setLayout(new QVBoxLayout); - QPushButton p("Raise the Window 2"); - window1.layout()->addWidget(&p); - window1.show(); - - QWidget window2(nullptr, Qt::Window); - window2.setWindowTitle("Window 2"); - window2.show(); - - WaylandXdgActivationV1 activation; - QObject::connect(&p, &QPushButton::clicked, &app, [&] { - QPlatformNativeInterface *native = qGuiApp->platformNativeInterface(); - auto seat = static_cast(native->nativeResourceForIntegration("wl_seat")); - wl_surface *surface = reinterpret_cast(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window1.windowHandle())); - auto req = activation.requestXdgActivationToken(seat, surface, 0, {}); - QObject::connect(req, &WaylandXdgActivationTokenV1::done, &app, [&activation, &window2](const QString &token) { - window2.show(); - QPlatformNativeInterface *native = qGuiApp->platformNativeInterface(); - wl_surface *surface = reinterpret_cast(native->nativeResourceForWindow(QByteArrayLiteral("surface"), window2.windowHandle())); - activation.activate(token, surface); - }); - }); - - return app.exec(); -} - -#include "xdgactivationtest-qt5.moc"