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);