summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/option.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/option.cpp b/src/option.cpp
index 4848f7b..dc51252 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -585,6 +585,19 @@ CompOption::rest ()
bool
CompOption::set (CompOption::Value &val)
{
+ if (isAction () &&
+ priv->value.action ().state () & CompAction::StateAutoGrab && screen)
+ {
+ if (!screen->addAction (&val.action ()))
+ {
+ return false;
+ }
+ else
+ {
+ screen->removeAction (&priv->value.action ());
+ }
+ }
+
if (priv->type == CompOption::TypeKey ||
priv->type == CompOption::TypeButton ||
priv->type == CompOption::TypeEdge ||
@@ -800,21 +813,6 @@ bool
CompOption::setOption (CompOption &o,
CompOption::Value &value)
{
- if (o.isAction () &&
- o.value ().action ().state () & CompAction::StateAutoGrab && screen)
- {
- if (!screen->addAction (&value.action ()))
- {
- return false;
- }
- else
- {
- screen->removeAction (&o.value ().action ());
- }
-
- return o.set (value);
- }
-
return o.set (value);
}