summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/trailfocus2.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-24 10:58:19 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-24 10:58:19 +0000
commit045ba4cb32fa3e1c16216ff8809bd40db9c2ed77 (patch)
treea5f6f2d27646d56bdcf42ddc15c05ce8da8c25e4 /beryl-plugins/src/trailfocus2.c
parentcf2abe773b6536e55c6d76d5444fac69ccf70773 (diff)
downloadmarex-dev-045ba4cb32fa3e1c16216ff8809bd40db9c2ed77.tar.gz
marex-dev-045ba4cb32fa3e1c16216ff8809bd40db9c2ed77.tar.bz2
indent.sh on plugins
git-svn-id: file:///beryl/trunk@3081 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/trailfocus2.c')
-rw-r--r--beryl-plugins/src/trailfocus2.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/beryl-plugins/src/trailfocus2.c b/beryl-plugins/src/trailfocus2.c
index 9c551ea..86b008b 100644
--- a/beryl-plugins/src/trailfocus2.c
+++ b/beryl-plugins/src/trailfocus2.c
@@ -100,7 +100,7 @@ static Bool is_trailfocus_window(TrailfocusScreen * ts, CompWindow * w)
{
if (!(w->type & ts->wMask))
return False;
- if (w->defaultPaintLock.opacity && w->defaultPaintLock.saturation
+ if (w->defaultPaintLock.opacity && w->defaultPaintLock.saturation
&& w->defaultPaintLock.brightness)
return False;
@@ -290,6 +290,7 @@ static void trailfocusHandleEvent(CompDisplay * d, XEvent * event)
{
TRAILFOCUS_DISPLAY(d);
CompScreen *s;
+
switch (event->type)
{
case FocusIn:
@@ -300,7 +301,7 @@ static void trailfocusHandleEvent(CompDisplay * d, XEvent * event)
default:
break;
}
-
+
UNWRAP(td, d, handleEvent);
(*d->handleEvent) (d, event);
@@ -315,11 +316,14 @@ static void recalculate_attributes(TrailfocusScreen * ts)
TfAttrib tmp, min, max;
int i;
int start;
+
start = ts->opt[SOPT_WINDOWS_START].value.i - 1;
ts->win_max = ts->opt[SOPT_WINDOWS].value.i;
- if (start >= ts->win_max) {
- fprintf(stderr, "trailfocus: WARNING: Attempting to define start higher than max windows.\n");
- start = ts->win_max-1;
+ if (start >= ts->win_max)
+ {
+ fprintf(stderr,
+ "trailfocus: WARNING: Attempting to define start higher than max windows.\n");
+ start = ts->win_max - 1;
}
min.opacity = ts->opt[SOPT_MIN_OPACITY].value.i * OPAQUE / 100;
@@ -333,19 +337,21 @@ static void recalculate_attributes(TrailfocusScreen * ts)
ts->inc = realloc(ts->inc, sizeof(TfAttrib) * (ts->win_max + 1));
tmp.opacity = (max.opacity - min.opacity) / ((ts->win_max - start));
- tmp.brightness = (max.brightness - min.brightness) / ((ts->win_max - start));
- tmp.saturation = (max.saturation - min.saturation) / ((ts->win_max - start));
+ tmp.brightness =
+ (max.brightness - min.brightness) / ((ts->win_max - start));
+ tmp.saturation =
+ (max.saturation - min.saturation) / ((ts->win_max - start));
for (i = 0; i < start; ++i)
ts->inc[i] = max;
- for (i = 0; i+start <= ts->win_max; i++)
+ for (i = 0; i + start <= ts->win_max; i++)
{
- ts->inc[i+start].opacity = max.opacity - (tmp.opacity * i);
- ts->inc[i+start].brightness = max.brightness - (tmp.brightness * i);
- ts->inc[i+start].saturation = max.saturation - (tmp.saturation * i);
- ts->win[i+start] = 0;
+ ts->inc[i + start].opacity = max.opacity - (tmp.opacity * i);
+ ts->inc[i + start].brightness = max.brightness - (tmp.brightness * i);
+ ts->inc[i + start].saturation = max.saturation - (tmp.saturation * i);
+ ts->win[i + start] = 0;
}
-// ts->inc[i+start] = min;
+// ts->inc[i+start] = min;
}
/* Unlike the traditional setScreenOptions, we return on failure in the