From 29e230dca3604f0202f480a4dd0c8fcbf7515865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 16 Aug 2013 19:38:26 +0200 Subject: [PATCH] enforce reactivation threshold to be 50ms bigger than actication threshold. Things don't work otherwise. BUG: 323588 FIXED-IN: 4.11.1 REVIEW: 112125 --- kcmkwin/kwinscreenedges/main.cpp | 8 ++++++++ kcmkwin/kwinscreenedges/main.h | 3 ++- screenedge.cpp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kcmkwin/kwinscreenedges/main.cpp b/kcmkwin/kwinscreenedges/main.cpp index 9de436a813..72d2b53dbd 100644 --- a/kcmkwin/kwinscreenedges/main.cpp +++ b/kcmkwin/kwinscreenedges/main.cpp @@ -54,6 +54,7 @@ KWinScreenEdgesConfig::KWinScreenEdgesConfig(QWidget* parent, const QVariantList connect(m_ui->monitor, SIGNAL(changed()), this, SLOT(changed())); connect(m_ui->desktopSwitchCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); + connect(m_ui->activationDelaySpin, SIGNAL(valueChanged(int)), this, SLOT(sanitizeCooldown())); connect(m_ui->activationDelaySpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); connect(m_ui->triggerCooldownSpin, SIGNAL(valueChanged(int)), this, SLOT(changed())); connect(m_ui->quickMaximizeBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); @@ -66,6 +67,8 @@ KWinScreenEdgesConfig::KWinScreenEdgesConfig(QWidget* parent, const QVariantList connect(m_ui->quickTileBox, SIGNAL(stateChanged(int)), this, SLOT(groupChanged())); load(); + + sanitizeCooldown(); } KWinScreenEdgesConfig::~KWinScreenEdgesConfig() @@ -147,6 +150,11 @@ void KWinScreenEdgesConfig::showEvent(QShowEvent* e) monitorShowEvent(); } +void KWinScreenEdgesConfig::sanitizeCooldown() +{ + m_ui->triggerCooldownSpin->setMinimum(m_ui->activationDelaySpin->value() + 50); +} + // Copied from kcmkwin/kwincompositing/main.cpp bool KWinScreenEdgesConfig::effectEnabled(const QString& effect, const KConfigGroup& cfg) const { diff --git a/kcmkwin/kwinscreenedges/main.h b/kcmkwin/kwinscreenedges/main.h index ec802d6be2..d42271022f 100644 --- a/kcmkwin/kwinscreenedges/main.h +++ b/kcmkwin/kwinscreenedges/main.h @@ -56,7 +56,8 @@ public slots: virtual void defaults(); protected: virtual void showEvent(QShowEvent* e); - +private slots: + void sanitizeCooldown(); private: KWinScreenEdgesConfigForm* m_ui; KSharedConfigPtr m_config; diff --git a/screenedge.cpp b/screenedge.cpp index 3d04f13d1a..a7169d7422 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -591,7 +591,7 @@ void ScreenEdges::reconfigure() // TODO: migrate settings to a group ScreenEdges KConfigGroup windowsConfig = m_config->group("Windows"); setTimeThreshold(windowsConfig.readEntry("ElectricBorderDelay", 150)); - setReActivationThreshold(windowsConfig.readEntry("ElectricBorderCooldown", 350)); + setReActivationThreshold(qMax(timeThreshold() + 50, windowsConfig.readEntry("ElectricBorderCooldown", 350))); int desktopSwitching = windowsConfig.readEntry("ElectricBorders", static_cast(ElectricDisabled)); if (desktopSwitching == ElectricDisabled) { setDesktopSwitching(false);