summaryrefslogtreecommitdiff
path: root/src/option.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2008-12-22 10:41:38 +0100
committerDennis Kasprzyk <onestone@compiz-fusion.org>2008-12-22 10:41:38 +0100
commit1acfd96b7843e28bc37b4b2e8da21b9ea3106fc7 (patch)
tree9aea7ce2d25121c087aaf4afe6302eef1e708254 /src/option.cpp
parent696e9970b993b9f2904f3d8b6b0e7867be87c140 (diff)
downloadunity-window-decorator-1acfd96b7843e28bc37b4b2e8da21b9ea3106fc7.tar.gz
unity-window-decorator-1acfd96b7843e28bc37b4b2e8da21b9ea3106fc7.tar.bz2
Add/Remove screen actions in CompOption::set function.
Diffstat (limited to 'src/option.cpp')
-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);
}