From 49e0b84d846dbb1aff044942116734296a7e496b Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 21 Nov 2020 12:16:59 +0200 Subject: [PATCH] wayland: Link statically KGlobalAccel integration plugin Without the KGlobalAccel integration plugin, Wayland experience will be negatively affected. Therefore it makes little sense to load it at run- time. --- CMakeLists.txt | 6 +++++- autotests/integration/CMakeLists.txt | 10 +++++++++- autotests/integration/kwin_wayland_test.cpp | 1 + main_wayland.cpp | 1 + plugins/kglobalaccel/CMakeLists.txt | 16 +++------------- plugins/kglobalaccel/kglobalaccel_plugin.h | 2 +- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index efa813eb6e..b8e45e9b55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -826,7 +826,11 @@ endif() add_subdirectory(platformsupport) add_subdirectory(plugins) -target_link_libraries(kwin_wayland KWinQpaPlugin) + +target_link_libraries(kwin_wayland + KWinQpaPlugin + KF5GlobalAccelPrivateKWin +) ########### install files ############### diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt index 9db3bf486c..db716644af 100644 --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -26,7 +26,15 @@ ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES BASENAME xdg-shell ) add_library(KWinIntegrationTestFramework STATIC ${KWinIntegrationTestFramework_SOURCES}) -target_link_libraries(KWinIntegrationTestFramework kwin Qt5::Test Wayland::Client KWinQpaPlugin) +target_link_libraries(KWinIntegrationTestFramework + Qt5::Test + kwin + Wayland::Client + + # Static plugins + KWinQpaPlugin + KF5GlobalAccelPrivateKWin +) function(integrationTest) set(optionArgs WAYLAND_ONLY) diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index 780bff9220..35e05372b1 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -31,6 +31,7 @@ #include Q_IMPORT_PLUGIN(KWinIntegrationPlugin) +Q_IMPORT_PLUGIN(KGlobalAccelImpl) namespace KWin { diff --git a/main_wayland.cpp b/main_wayland.cpp index 89efc46e0a..ed69a592d5 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -61,6 +61,7 @@ #include Q_IMPORT_PLUGIN(KWinIntegrationPlugin) +Q_IMPORT_PLUGIN(KGlobalAccelImpl) namespace KWin { diff --git a/plugins/kglobalaccel/CMakeLists.txt b/plugins/kglobalaccel/CMakeLists.txt index 96651f466c..656f14c591 100644 --- a/plugins/kglobalaccel/CMakeLists.txt +++ b/plugins/kglobalaccel/CMakeLists.txt @@ -2,16 +2,6 @@ set(kglobalaccel_plugin_SRCS kglobalaccel_plugin.cpp ) -add_library(KF5GlobalAccelPrivateKWin MODULE ${kglobalaccel_plugin_SRCS}) -set_target_properties(KF5GlobalAccelPrivateKWin PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kglobalaccel5.platforms/") -target_link_libraries(KF5GlobalAccelPrivateKWin - KF5::GlobalAccelPrivate - kwin -) - -install( - TARGETS - KF5GlobalAccelPrivateKWin - DESTINATION - ${PLUGIN_INSTALL_DIR}/org.kde.kglobalaccel5.platforms/ -) +add_library(KF5GlobalAccelPrivateKWin OBJECT ${kglobalaccel_plugin_SRCS}) +target_compile_definitions(KF5GlobalAccelPrivateKWin PRIVATE QT_STATICPLUGIN) +target_link_libraries(KF5GlobalAccelPrivateKWin KF5::GlobalAccelPrivate kwin) diff --git a/plugins/kglobalaccel/kglobalaccel_plugin.h b/plugins/kglobalaccel/kglobalaccel_plugin.h index 7ee1778cf6..a8f8fc36f8 100644 --- a/plugins/kglobalaccel/kglobalaccel_plugin.h +++ b/plugins/kglobalaccel/kglobalaccel_plugin.h @@ -16,7 +16,7 @@ class KGlobalAccelImpl : public KGlobalAccelInterface { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.kde.kglobalaccel5.KGlobalAccelInterface" FILE "kwin.json") + Q_PLUGIN_METADATA(IID KGlobalAccelInterface_iid FILE "kwin.json") Q_INTERFACES(KGlobalAccelInterface) public: