From 57e0119d23321a414b33c8bce629349d25a934af Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 9 Mar 2022 17:25:44 +0100 Subject: [PATCH] Adapt to Qt6's removal of Qt::X11Extras --- autotests/CMakeLists.txt | 24 +++++++++++++++---- autotests/libkwineffects/CMakeLists.txt | 5 +++- autotests/libxrenderutils/CMakeLists.txt | 6 ++++- .../libxrenderutils/blendpicture_test.cpp | 4 ++++ autotests/tabbox/CMakeLists.txt | 8 +++++-- autotests/tabbox/test_tabbox_clientmodel.cpp | 4 ++++ autotests/tabbox/test_tabbox_handler.cpp | 4 ++++ autotests/test_client_machine.cpp | 4 ++++ autotests/test_x11_timestamp_update.cpp | 4 ++++ autotests/test_xcb_size_hints.cpp | 4 ++++ autotests/test_xcb_window.cpp | 4 ++++ autotests/test_xcb_wrapper.cpp | 4 ++++ src/CMakeLists.txt | 4 +++- src/backends/x11/standalone/CMakeLists.txt | 5 +++- src/backends/x11/standalone/glxbackend.cpp | 4 ++++ .../standalone/omlsynccontrolvsyncmonitor.cpp | 4 ++++ .../standalone/sgivideosyncvsyncmonitor.cpp | 4 ++++ src/backends/x11/standalone/x11_platform.cpp | 4 ++++ src/helpers/killer/CMakeLists.txt | 6 ++++- src/helpers/killer/killer.cpp | 6 ++++- src/main_x11.cpp | 4 ++++ src/platform.cpp | 4 ++++ tests/CMakeLists.txt | 14 +++++++++-- tests/screenedgeshowtest.cpp | 4 ++++ tests/x11shadowreader.cpp | 4 ++++ 25 files changed, 128 insertions(+), 14 deletions(-) diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 17800c0288..b0097d809b 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -60,7 +60,6 @@ target_link_libraries(testClientMachine Qt::Concurrent Qt::Test Qt::Widgets - Qt::X11Extras KF5::ConfigCore KF5::WindowSystem @@ -70,6 +69,11 @@ 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) @@ -84,13 +88,17 @@ add_executable(testXcbWrapper ${testXcbWrapper_SRCS}) target_link_libraries(testXcbWrapper Qt::Test Qt::Widgets - Qt::X11Extras KF5::ConfigCore KF5::WindowSystem 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) @@ -100,7 +108,6 @@ if (XCB_ICCCM_FOUND) target_link_libraries(testXcbSizeHints Qt::Test Qt::Widgets - Qt::X11Extras KF5::ConfigCore KF5::WindowSystem @@ -108,6 +115,11 @@ 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() @@ -123,13 +135,17 @@ add_executable(testXcbWindow ${testXcbWindow_SRCS}) target_link_libraries(testXcbWindow Qt::Test Qt::Widgets - Qt::X11Extras KF5::ConfigCore KF5::WindowSystem 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) diff --git a/autotests/libkwineffects/CMakeLists.txt b/autotests/libkwineffects/CMakeLists.txt index 62645d9fee..090d18f9bb 100644 --- a/autotests/libkwineffects/CMakeLists.txt +++ b/autotests/libkwineffects/CMakeLists.txt @@ -16,5 +16,8 @@ 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 Qt::X11Extras KF5::ConfigCore XCB::XCB) +target_link_libraries(kwinglplatformtest Qt::Test Qt::Gui KF5::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/libxrenderutils/CMakeLists.txt b/autotests/libxrenderutils/CMakeLists.txt index 1421a14a32..2fb9860846 100644 --- a/autotests/libxrenderutils/CMakeLists.txt +++ b/autotests/libxrenderutils/CMakeLists.txt @@ -5,9 +5,13 @@ target_link_libraries(blendPictureTest kwinxrenderutils Qt::Test Qt::Gui - Qt::X11Extras XCB::XCB XCB::RENDER XCB::XFIXES ) +if (QT_MAJOR_VERSION EQUAL "5") + target_link_libraries(blendPictureTest Qt::X11Extras) +else() + target_link_libraries(blendPictureTest Qt::GuiPrivate) +endif() ecm_mark_as_test(blendPictureTest) diff --git a/autotests/libxrenderutils/blendpicture_test.cpp b/autotests/libxrenderutils/blendpicture_test.cpp index 09009df624..8e877941e5 100644 --- a/autotests/libxrenderutils/blendpicture_test.cpp +++ b/autotests/libxrenderutils/blendpicture_test.cpp @@ -8,7 +8,11 @@ */ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include "../testutils.h" diff --git a/autotests/tabbox/CMakeLists.txt b/autotests/tabbox/CMakeLists.txt index b3bc2be0e9..0d7f7b97f5 100644 --- a/autotests/tabbox/CMakeLists.txt +++ b/autotests/tabbox/CMakeLists.txt @@ -22,7 +22,6 @@ target_link_libraries(testTabBoxClientModel Qt::Quick Qt::Test Qt::Widgets - Qt::X11Extras Qt::GuiPrivate KF5::ConfigCore @@ -32,6 +31,9 @@ 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) @@ -57,7 +59,6 @@ target_link_libraries(testTabBoxHandler Qt::Quick Qt::Test Qt::Widgets - Qt::X11Extras Qt::GuiPrivate KF5::ConfigCore @@ -67,6 +68,9 @@ 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 14f637c65d..1800d834fd 100644 --- a/autotests/tabbox/test_tabbox_clientmodel.cpp +++ b/autotests/tabbox/test_tabbox_clientmodel.cpp @@ -12,7 +12,11 @@ #include "../testutils.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 7a36500e65..49bae32dfa 100644 --- a/autotests/tabbox/test_tabbox_handler.cpp +++ b/autotests/tabbox/test_tabbox_handler.cpp @@ -10,7 +10,11 @@ #include "clientmodel.h" #include "../testutils.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 5aff04cff3..d84e0cca12 100644 --- a/autotests/test_client_machine.cpp +++ b/autotests/test_client_machine.cpp @@ -13,7 +13,11 @@ // 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 624f6da8d3..499af97aae 100644 --- a/autotests/test_x11_timestamp_update.cpp +++ b/autotests/test_x11_timestamp_update.cpp @@ -8,7 +8,11 @@ */ #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include diff --git a/autotests/test_xcb_size_hints.cpp b/autotests/test_xcb_size_hints.cpp index dfc090389c..ec03807b85 100644 --- a/autotests/test_xcb_size_hints.cpp +++ b/autotests/test_xcb_size_hints.cpp @@ -12,7 +12,11 @@ // 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 d9feed5780..4bfa98a8ee 100644 --- a/autotests/test_xcb_window.cpp +++ b/autotests/test_xcb_window.cpp @@ -12,7 +12,11 @@ // 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 9aa4abaaa1..30f2468cc8 100644 --- a/autotests/test_xcb_wrapper.cpp +++ b/autotests/test_xcb_wrapper.cpp @@ -12,7 +12,11 @@ // Qt #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include // xcb #include diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 41ae478a0f..4e2d3c358c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -288,8 +288,10 @@ add_executable(kwin_x11 main_x11.cpp) target_link_libraries(kwin_x11 kwin KF5::Crash - Qt::X11Extras ) +if (QT_MAJOR_VERSION EQUAL "5") + target_link_libraries(kwin_x11 Qt::X11Extras) +endif() kcoreaddons_target_static_plugins(kwin_x11 "kwin/effects/plugins") install(TARGETS kwin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) diff --git a/src/backends/x11/standalone/CMakeLists.txt b/src/backends/x11/standalone/CMakeLists.txt index acb6612d1b..cca1c682d2 100644 --- a/src/backends/x11/standalone/CMakeLists.txt +++ b/src/backends/x11/standalone/CMakeLists.txt @@ -17,7 +17,10 @@ set(X11PLATFORM_SOURCES add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES}) set_target_properties(KWinX11Platform PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.platforms/") -target_link_libraries(KWinX11Platform eglx11common kwin kwinxrenderutils Qt::X11Extras KF5::Crash X11::X11) +target_link_libraries(KWinX11Platform eglx11common kwin kwinxrenderutils KF5::Crash X11::X11) +if (QT_MAJOR_VERSION EQUAL "5") + target_link_libraries(KWinX11Platform Qt::X11Extras) +endif() if (X11_Xi_FOUND) target_sources(KWinX11Platform PRIVATE xinputintegration.cpp) target_link_libraries(KWinX11Platform X11::Xi) diff --git a/src/backends/x11/standalone/glxbackend.cpp b/src/backends/x11/standalone/glxbackend.cpp index d039ec5613..e9297ec3b0 100644 --- a/src/backends/x11/standalone/glxbackend.cpp +++ b/src/backends/x11/standalone/glxbackend.cpp @@ -38,7 +38,11 @@ // Qt #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include // system #include diff --git a/src/backends/x11/standalone/omlsynccontrolvsyncmonitor.cpp b/src/backends/x11/standalone/omlsynccontrolvsyncmonitor.cpp index 0d3bfddb8b..0a7d259a6a 100644 --- a/src/backends/x11/standalone/omlsynccontrolvsyncmonitor.cpp +++ b/src/backends/x11/standalone/omlsynccontrolvsyncmonitor.cpp @@ -8,7 +8,11 @@ #include "glxconvenience.h" #include "logging.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif namespace KWin { diff --git a/src/backends/x11/standalone/sgivideosyncvsyncmonitor.cpp b/src/backends/x11/standalone/sgivideosyncvsyncmonitor.cpp index 748f1e8794..3ac69601d0 100644 --- a/src/backends/x11/standalone/sgivideosyncvsyncmonitor.cpp +++ b/src/backends/x11/standalone/sgivideosyncvsyncmonitor.cpp @@ -8,7 +8,11 @@ #include "glxconvenience.h" #include "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_platform.cpp b/src/backends/x11/standalone/x11_platform.cpp index a4dc495522..b3a42e7a3c 100644 --- a/src/backends/x11/standalone/x11_platform.cpp +++ b/src/backends/x11/standalone/x11_platform.cpp @@ -42,7 +42,11 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif namespace KWin { diff --git a/src/helpers/killer/CMakeLists.txt b/src/helpers/killer/CMakeLists.txt index d6246a18e5..ecd3703251 100644 --- a/src/helpers/killer/CMakeLists.txt +++ b/src/helpers/killer/CMakeLists.txt @@ -9,7 +9,11 @@ target_link_libraries(kwin_killer_helper KF5::I18n KF5::WidgetsAddons Qt::Widgets - Qt::X11Extras ) +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 946f260ffe..3a6d073acb 100644 --- a/src/helpers/killer/killer.cpp +++ b/src/helpers/killer/killer.cpp @@ -17,7 +17,11 @@ #include #include #include -#include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else +#include +#endif #include #include diff --git a/src/main_x11.cpp b/src/main_x11.cpp index 95626f83e4..7b506043e5 100644 --- a/src/main_x11.cpp +++ b/src/main_x11.cpp @@ -34,7 +34,11 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include // system diff --git a/src/platform.cpp b/src/platform.cpp index 7752b2e110..6e0a575cb0 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -28,7 +28,11 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 155de52818..e56541c396 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,11 +7,21 @@ endif() # next target set(screenedgeshowtest_SRCS screenedgeshowtest.cpp) add_executable(screenedgeshowtest ${screenedgeshowtest_SRCS}) -target_link_libraries(screenedgeshowtest Qt::Widgets Qt::X11Extras KF5::ConfigCore KF5::WindowSystem KF5::WaylandClient ${XCB_XCB_LIBRARY}) +target_link_libraries(screenedgeshowtest Qt::Widgets KF5::ConfigCore KF5::WindowSystem KF5::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_include_directories(screenedgeshowtest PRIVATE ${CMAKE_SOURCE_DIR}/src) add_executable(x11shadowreader x11shadowreader.cpp) -target_link_libraries(x11shadowreader XCB::XCB Qt::Widgets Qt::X11Extras KF5::ConfigCore KF5::WindowSystem) +target_link_libraries(x11shadowreader XCB::XCB Qt::Widgets KF5::ConfigCore KF5::WindowSystem) +if (QT_MAJOR_VERSION EQUAL "5") + target_link_libraries(x11shadowreader Qt::X11Extras) +else() + target_link_libraries(x11shadowreader Qt::GuiPrivate) +endif() target_include_directories(x11shadowreader PRIVATE ${CMAKE_SOURCE_DIR}/src) add_executable(pointerconstraints pointerconstraintstest.cpp) diff --git a/tests/screenedgeshowtest.cpp b/tests/screenedgeshowtest.cpp index 109aacd2d0..9846c758d6 100644 --- a/tests/screenedgeshowtest.cpp +++ b/tests/screenedgeshowtest.cpp @@ -16,7 +16,11 @@ #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 abd6f40eff..d2cf6d4715 100644 --- a/tests/x11shadowreader.cpp +++ b/tests/x11shadowreader.cpp @@ -12,7 +12,11 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#else #include +#endif static QVector readShadow(quint32 windowId) {