enforce reactivation threshold to be 50ms bigger

than actication threshold.
Things don't work otherwise.

BUG: 323588
FIXED-IN: 4.11.1
REVIEW: 112125
This commit is contained in:
Thomas Lübking 2013-08-16 19:38:26 +02:00
parent 7d6d80351c
commit 29e230dca3
3 changed files with 11 additions and 2 deletions

View file

@ -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
{

View file

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

View file

@ -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<int>(ElectricDisabled));
if (desktopSwitching == ElectricDisabled) {
setDesktopSwitching(false);