From 318246ea2ef5a0625037e7f4941442f6923b5dbb Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 2 May 2022 20:23:39 +0300 Subject: [PATCH] kwin: remove non-operational screen locking prevention action Signed-off-by: Ivailo Monev --- kwin/kcmkwin/kwinscreenedges/main.cpp | 19 ------------------- kwin/kcmkwin/kwinscreenedges/main.h | 10 +++++----- kwin/libkwineffects/kwinglobals.h | 3 +-- kwin/screenedge.cpp | 2 -- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/kwin/kcmkwin/kwinscreenedges/main.cpp b/kwin/kcmkwin/kwinscreenedges/main.cpp index 682edade..f3ba0f9f 100644 --- a/kwin/kcmkwin/kwinscreenedges/main.cpp +++ b/kwin/kcmkwin/kwinscreenedges/main.cpp @@ -187,12 +187,6 @@ void KWinScreenEdgesConfig::monitorInit() monitorAddItem(i18n("No Action")); monitorAddItem(i18n("Show Desktop")); monitorAddItem(i18n("Lock Screen")); - monitorAddItem(i18n("Prevent Screen Locking")); - //Prevent Screen Locking is not supported on some edges - m_ui->monitor->setEdgeItemEnabled(Monitor::Top, 4, false); - m_ui->monitor->setEdgeItemEnabled(Monitor::Left, 4, false); - m_ui->monitor->setEdgeItemEnabled(Monitor::Right, 4, false); - m_ui->monitor->setEdgeItemEnabled(Monitor::Bottom, 4, false); // Search the effect names KServiceTypeTrader* trader = KServiceTypeTrader::self(); @@ -215,7 +209,6 @@ void KWinScreenEdgesConfig::monitorLoadAction(ElectricBorder edge, const QString QString lowerName = config.readEntry(configName, "None").toLower(); if (lowerName == "showdesktop") monitorChangeEdge(edge, ElectricActionShowDesktop); else if (lowerName == "lockscreen") monitorChangeEdge(edge, ElectricActionLockScreen); - else if (lowerName == "preventscreenlocking") monitorChangeEdge(edge, ElectricActionPreventScreenLocking); } void KWinScreenEdgesConfig::monitorLoad() @@ -282,20 +275,8 @@ void KWinScreenEdgesConfig::monitorSaveAction(int edge, const QString& configNam config.writeEntry(configName, "ShowDesktop"); else if (item == 2) config.writeEntry(configName, "LockScreen"); - else if (item == 3) - config.writeEntry(configName, "PreventScreenLocking"); else // Anything else config.writeEntry(configName, "None"); - - if ((edge == Monitor::TopRight) || - (edge == Monitor::BottomRight) || - (edge == Monitor::BottomLeft) || - (edge == Monitor::TopLeft)) { - KConfig scrnConfig("kscreensaverrc"); - KConfigGroup scrnGroup = scrnConfig.group("ScreenSaver"); - scrnGroup.writeEntry("Action" + configName, (item == 4) ? 2 /* Prevent Screen Locking */ : 0 /* None */); - scrnGroup.sync(); - } } void KWinScreenEdgesConfig::monitorSave() diff --git a/kwin/kcmkwin/kwinscreenedges/main.h b/kwin/kcmkwin/kwinscreenedges/main.h index 11de59f3..1b27de04 100644 --- a/kwin/kcmkwin/kwinscreenedges/main.h +++ b/kwin/kcmkwin/kwinscreenedges/main.h @@ -64,11 +64,11 @@ private: enum EffectActions { PresentWindowsAll = ELECTRIC_ACTION_COUNT, // Start at the end of built in actions - PresentWindowsCurrent = 5, - PresentWindowsClass = 6, - DesktopGrid = 7, - TabBox = 8, - TabBoxAlternative = 9 + PresentWindowsCurrent = 4, + PresentWindowsClass = 5, + DesktopGrid = 6, + TabBox = 7, + TabBoxAlternative = 8 }; bool effectEnabled(const QString& effect, const KConfigGroup& cfg) const; diff --git a/kwin/libkwineffects/kwinglobals.h b/kwin/libkwineffects/kwinglobals.h index b86ab2fa..4393fa1b 100644 --- a/kwin/libkwineffects/kwinglobals.h +++ b/kwin/libkwineffects/kwinglobals.h @@ -74,8 +74,7 @@ enum ElectricBorderAction { ElectricActionNone = 0, // No special action, not set, desktop switch or an effect ElectricActionShowDesktop = 1, // Show desktop or restore ElectricActionLockScreen = 2, // Lock screen - ElectricActionPreventScreenLocking = 3, - ELECTRIC_ACTION_COUNT = 4 + ELECTRIC_ACTION_COUNT = 3 }; // DesktopMode and WindowsMode are based on the order in which the desktop diff --git a/kwin/screenedge.cpp b/kwin/screenedge.cpp index 41965076..8d0f2e35 100644 --- a/kwin/screenedge.cpp +++ b/kwin/screenedge.cpp @@ -576,8 +576,6 @@ static ElectricBorderAction electricBorderAction(const QString& name) return ElectricActionShowDesktop; } else if (lowerName == "lockscreen") { return ElectricActionLockScreen; - } else if (lowerName == "preventscreenlocking") { - return ElectricActionPreventScreenLocking; } return ElectricActionNone; }