From 24bfca7959850f96ca5d1db74b9e65032d0f930e Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 19 Jun 2023 14:36:42 +0300 Subject: [PATCH] Drop "Configure Window Manager" entry in user actions menu Because the kcm list has to be maintained manually, it's prone to get outdated and incomplete (it already is!). On the other hand, "configure window manager" is somewhat redundant as same kcms can be opened in system settings. --- src/useractions.cpp | 46 --------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/src/useractions.cpp b/src/useractions.cpp index e7679b5543..7d315a8f3a 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -185,24 +185,6 @@ void UserActionsMenu::helperDialog(const QString &message) KProcess::startDetached(QStringLiteral("kdialog"), args); } -QStringList configModules(bool controlCenter) -{ - QStringList args; - args << QStringLiteral("kwindecoration"); - if (controlCenter) { - args << QStringLiteral("kwinoptions"); - } else if (KAuthorized::authorizeControlModule(QStringLiteral("kde-kwinoptions.desktop"))) { - args << QStringLiteral("kwinactions") << QStringLiteral("kwinfocus") << QStringLiteral("kwinmoving") << QStringLiteral("kwinadvanced") - << QStringLiteral("kwinrules") << QStringLiteral("kwincompositing") << QStringLiteral("kwineffects") -#if KWIN_BUILD_TABBOX - << QStringLiteral("kwintabbox") -#endif - << QStringLiteral("kwinscreenedges") - << QStringLiteral("kwinscripts"); - } - return args; -} - void UserActionsMenu::init() { if (m_menu) { @@ -286,34 +268,6 @@ void UserActionsMenu::init() action->setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-windows-actions"))); action->setData(Options::ApplicationRulesOp); m_applicationRulesOperation = action; - if (!kwinApp()->config()->isImmutable() && !KAuthorized::authorizeControlModules(configModules(true)).isEmpty()) { - advancedMenu->addSeparator(); - action = advancedMenu->addAction(i18nc("Entry in context menu of window decoration to open the configuration module of KWin", - "Configure W&indow Manager...")); - action->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); - connect(action, &QAction::triggered, this, [this]() { - // opens the KWin configuration - QStringList args; - args << QStringLiteral("--icon") << QStringLiteral("preferences-system-windows"); - const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, - QStringLiteral("kservices5/kwinfocus.desktop")); - if (!path.isEmpty()) { - args << QStringLiteral("--desktopfile") << path; - } - args << configModules(false); - QProcess *p = new QProcess(this); - p->setArguments(args); - p->setProcessEnvironment(kwinApp()->processStartupEnvironment()); - p->setProgram(QStringLiteral("kcmshell6")); - connect(p, static_cast(&QProcess::finished), p, &QProcess::deleteLater); - connect(p, &QProcess::errorOccurred, this, [](QProcess::ProcessError e) { - if (e == QProcess::FailedToStart) { - qCDebug(KWIN_CORE) << "Failed to start kcmshell6"; - } - }); - p->start(); - }); - } #endif m_maximizeOperation = m_menu->addAction(i18n("Ma&ximize"));