From ecc938a6663ab56a501ab3e5ffa9ed55444af779 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Tue, 15 Mar 2022 20:57:03 -0600 Subject: [PATCH] Remove "Lock" and "logout" items from default desktop context menu These items don't have anything to do with the desktop itself, so that's not really the right place for them, making it unlikely that anyone would expect to find them in the desktop context menu. Instead, these items are probably there as a sort of emergency escape valve so that people can still lock the screen and log out under the following set of circumstances: 1. They've accidentally removed their launcher menu or primary panel, or it has gotten lost due to multi-screen arrangement bugs 2. ...And they don't know how to perform these actions from KRunner 3. ...And they don't know the keyboard shortcuts for these actions This seems very unlikely, given how we have made it much harder to accidentally remove your panel and its applets over time, how much robustness work we've put into multimonitor workflows, and how we now even have a UI to restore panels that have gotten lost anyway. So having these actions in the context menu specifically to protect against such an unlikely happenstance is therefore not worth it, and we can safely remove them by default (note that users can add them back) to unclutter the context menu and make it more relevant to the desktop itself. --- There is no need to handle the now-orphaned menu separator as QMenu takes care of automaticlaly suppressing separators when they are the last item in the menu. --- containmentactions/contextmenu/menu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/containmentactions/contextmenu/menu.cpp b/containmentactions/contextmenu/menu.cpp index 1207dd2b3..ea3023152 100644 --- a/containmentactions/contextmenu/menu.cpp +++ b/containmentactions/contextmenu/menu.cpp @@ -75,6 +75,8 @@ void ContextMenu::restore(const KConfigGroup &config) disabled.insert(QStringLiteral("configure shortcuts")); disabled.insert(QStringLiteral("_run_command")); disabled.insert(QStringLiteral("run associated application")); + disabled.insert(QStringLiteral("_lock_screen")); + disabled.insert(QStringLiteral("_logout")); } // clang-format on