From 996e84017279642488da62cf004aab25efc6a584 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 22 Jan 2020 12:45:51 +0000 Subject: [PATCH] Drop kdeinit linking Summary: This wasn't used on startup (ksmserver calls KProcess) Nor for the rules dialog (kwin invokes it with QProcess) We may as well simplify the code and drop the dependency See also T12140 Test Plan: Restarted Opened the rules dialog Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D26835 --- CMakeLists.txt | 48 +++++++++++++++----------------- kcmkwin/kwinrules/CMakeLists.txt | 9 ++---- kcmkwin/kwinrules/main.cpp | 3 +- main_x11.cpp | 3 +- 4 files changed, 28 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5261958a0..5616569001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n IconThemes IdleTime - Init Notifications Package Plasma @@ -392,7 +391,7 @@ add_subdirectory(helpers) ########### next target ############### -set(kwin_KDEINIT_SRCS +set(kwin_SRCS abstract_client.cpp abstract_opengl_context_attribute_builder.cpp abstract_output.cpp @@ -504,14 +503,14 @@ set(kwin_KDEINIT_SRCS ) if (CMAKE_SYSTEM_NAME MATCHES "Linux") - set(kwin_KDEINIT_SRCS - ${kwin_KDEINIT_SRCS} + set(kwin_SRCS + ${kwin_SRCS} colorcorrection/clockskewnotifierengine_linux.cpp ) endif() include(ECMQtDeclareLoggingCategory) -ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS +ecm_qt_declare_logging_category(kwin_SRCS HEADER colorcorrect_logging.h IDENTIFIER @@ -524,7 +523,7 @@ ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS if (KWIN_BUILD_TABBOX) include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) - set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS} + set(kwin_SRCS ${kwin_SRCS} tabbox/clientmodel.cpp tabbox/desktopchain.cpp tabbox/desktopmodel.cpp @@ -538,33 +537,33 @@ if (KWIN_BUILD_TABBOX) endif() if (KWIN_BUILD_ACTIVITIES) - set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS} + set(kwin_SRCS ${kwin_SRCS} activities.cpp ) endif() if (HAVE_LINUX_VT_H) - set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS} + set(kwin_SRCS ${kwin_SRCS} virtual_terminal.cpp ) endif() -kconfig_add_kcfg_files(kwin_KDEINIT_SRCS settings.kcfgc) -kconfig_add_kcfg_files(kwin_KDEINIT_SRCS colorcorrection/colorcorrect_settings.kcfgc) +kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc) +kconfig_add_kcfg_files(kwin_SRCS colorcorrection/colorcorrect_settings.kcfgc) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.OrientationSensor.xml orientation_sensor.h KWin::OrientationSensor) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface) -qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager) +qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface) +qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface) +qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface) +qt5_add_dbus_adaptor(kwin_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl) +qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.OrientationSensor.xml orientation_sensor.h KWin::OrientationSensor) +qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface) +qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager) -qt5_add_dbus_interface(kwin_KDEINIT_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface) -qt5_add_dbus_interface(kwin_KDEINIT_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface) -qt5_add_dbus_interface(kwin_KDEINIT_SRCS org.kde.kappmenu.xml appmenu_interface) +qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface) +qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface) +qt5_add_dbus_interface(kwin_SRCS org.kde.kappmenu.xml appmenu_interface) -ki18n_wrap_ui(kwin_KDEINIT_SRCS +ki18n_wrap_ui(kwin_SRCS debug_console.ui shortcutdialog.ui ) @@ -647,7 +646,7 @@ set(kwinLibs Libinput::Libinput ) -add_library(kwin SHARED ${kwin_KDEINIT_SRCS}) +add_library(kwin SHARED ${kwin_SRCS}) set_target_properties(kwin PROPERTIES VERSION ${PROJECT_VERSION} @@ -659,11 +658,10 @@ generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h) target_link_libraries(kwin kwinglutils ${epoxy_LIBRARY}) -kf5_add_kdeinit_executable(kwin_x11 main_x11.cpp) -target_link_libraries(kdeinit_kwin_x11 kwin KF5::Crash Qt5::X11Extras) +add_executable(kwin_x11 main_x11.cpp) +target_link_libraries(kwin_x11 kwin KF5::Crash Qt5::X11Extras) install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) -install(TARGETS kdeinit_kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS}) set(kwin_XWAYLAND_SRCS diff --git a/kcmkwin/kwinrules/CMakeLists.txt b/kcmkwin/kwinrules/CMakeLists.txt index d8839c03d0..bee3e2ee27 100644 --- a/kcmkwin/kwinrules/CMakeLists.txt +++ b/kcmkwin/kwinrules/CMakeLists.txt @@ -6,13 +6,11 @@ add_definitions(-DKCMRULES) include_directories(../../) set(kwinrules_MOC_HDRS yesnobox.h ../../cursor.h ../../plugins/platforms/x11/standalone/x11cursor.h) qt5_wrap_cpp(kwinrules_MOC_SRCS ${kwinrules_MOC_HDRS}) -set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp ${kwinrules_MOC_SRCS}) +set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp main.cpp ${kwinrules_MOC_SRCS}) ki18n_wrap_ui(kwinrules_SRCS ruleslist.ui detectwidget.ui editshortcut.ui ruleswidgetbase.ui) -set(kwin_rules_dialog_KDEINIT_SRCS main.cpp ${kwinrules_SRCS}) - -kf5_add_kdeinit_executable(kwin_rules_dialog ${kwin_rules_dialog_KDEINIT_SRCS}) +add_executable(kwin_rules_dialog ${kwinrules_SRCS}) set(kwin_kcm_rules_XCB_LIBS XCB::CURSOR @@ -36,9 +34,8 @@ if (KWIN_BUILD_ACTIVITIES) set(kcm_libs ${kcm_libs} KF5::Activities) endif() -target_link_libraries(kdeinit_kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS}) +target_link_libraries(kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS}) -install(TARGETS kdeinit_kwin_rules_dialog ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS kwin_rules_dialog DESTINATION ${LIBEXEC_INSTALL_DIR}) ########### next target ############### diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index 02663ab476..f27a856337 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -233,8 +233,7 @@ static void edit(const QVariantMap &data, bool whole_app) } // namespace -extern "C" -KWIN_EXPORT int kdemain(int argc, char* argv[]) +int main(int argc, char* argv[]) { QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); diff --git a/main_x11.cpp b/main_x11.cpp index ff6184fe31..4349a7e8da 100644 --- a/main_x11.cpp +++ b/main_x11.cpp @@ -340,8 +340,7 @@ void ApplicationX11::crashHandler(int signal) } // namespace -extern "C" -KWIN_EXPORT int kdemain(int argc, char * argv[]) +int main(int argc, char * argv[]) { KWin::Application::setupMalloc(); KWin::Application::setupLocalizedString();