From a56b16e2ff304db3b209fe7f30ef42a1c0e6919a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Venerandi?= Date: Tue, 4 Jun 2024 11:43:19 +0200 Subject: [PATCH] Remove orphan shortcuts for desktop grid and expose effects BUG:487974 --- kconf_update/CMakeLists.txt | 5 +++ ...n-6.1-remove-gridview-expose-shortcuts.cpp | 35 +++++++++++++++++++ kconf_update/kwin.upd | 4 +++ 3 files changed, 44 insertions(+) create mode 100644 kconf_update/kwin-6.1-remove-gridview-expose-shortcuts.cpp diff --git a/kconf_update/CMakeLists.txt b/kconf_update/CMakeLists.txt index 54bab696bb..cf9135caff 100644 --- a/kconf_update/CMakeLists.txt +++ b/kconf_update/CMakeLists.txt @@ -16,5 +16,10 @@ target_sources(kwin-6.0-remove-breeze-tabbox-default PRIVATE kwin-6.0-remove-bre target_link_libraries(kwin-6.0-remove-breeze-tabbox-default PRIVATE KF6::ConfigCore) install(TARGETS kwin-6.0-remove-breeze-tabbox-default DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/) +add_executable(kwin-6.1-remove-gridview-expose-shortcuts) +target_sources(kwin-6.1-remove-gridview-expose-shortcuts PRIVATE kwin-6.1-remove-gridview-expose-shortcuts.cpp) +target_link_libraries(kwin-6.1-remove-gridview-expose-shortcuts PRIVATE KF6::GlobalAccel) +install(TARGETS kwin-6.1-remove-gridview-expose-shortcuts DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/) + install(FILES kwin.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) diff --git a/kconf_update/kwin-6.1-remove-gridview-expose-shortcuts.cpp b/kconf_update/kwin-6.1-remove-gridview-expose-shortcuts.cpp new file mode 100644 index 0000000000..2568979c02 --- /dev/null +++ b/kconf_update/kwin-6.1-remove-gridview-expose-shortcuts.cpp @@ -0,0 +1,35 @@ +/* + SPDX-FileCopyrightText: 2023 Marco Martin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include + +#include +#include +#include + +int main(int argc, char **argv) +{ + QGuiApplication app(argc, argv); + + const QStringList actionNames{ + QStringLiteral("ShowDesktopGrid"), + QStringLiteral("Expose"), + QStringLiteral("ExposeAll"), + QStringLiteral("ExposeClass"), + QStringLiteral("ExposeClassCurrentDesktop"), + }; + + for (const QString &actionName : actionNames) { + QAction action; + action.setObjectName(actionName); + action.setProperty("componentName", QStringLiteral("kwin")); + action.setProperty("componentDisplayName", QStringLiteral("KWin")); + KGlobalAccel::self()->setShortcut(&action, {QKeySequence()}, KGlobalAccel::NoAutoloading); + KGlobalAccel::self()->removeAllShortcuts(&action); + } + + return 0; +} diff --git a/kconf_update/kwin.upd b/kconf_update/kwin.upd index 8b4e3d1803..b7985e6a27 100644 --- a/kconf_update/kwin.upd +++ b/kconf_update/kwin.upd @@ -14,3 +14,7 @@ Script=kwin-6.0-delete-desktop-switching-shortcuts # Delete old tabbox defaults Id=kwin-6.0-remove-breeze-tabbox-default Script=kwin-6.0-remove-breeze-tabbox-default + +# Delete old gridview and expose defaults +Id=kwin-6.1-remove-gridview-expose-shortcuts +Script=kwin-6.1-remove-gridview-expose-shortcuts