summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarex <marex@beryl-project.org>2007-05-01 14:25:44 +0200
committermarex <marex@beryl-project.org>2007-05-01 14:25:44 +0200
commit17ea52f3b3fda9d279473f9cfe2c733e85767cbb (patch)
tree7f95575bab147541d9e23a5d386e8a40cdbaa52a
parentb15a6e4ab175d521e62086bfcd96f616dbe120c3 (diff)
downloadberyl-premerge-17ea52f3b3fda9d279473f9cfe2c733e85767cbb.tar.gz
beryl-premerge-17ea52f3b3fda9d279473f9cfe2c733e85767cbb.tar.bz2
addhelper: Fixed author issues and hopefully provided an adequate
documentation.
-rw-r--r--src/addhelper.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/addhelper.c b/src/addhelper.c
index 6aaa54d..299f5b7 100644
--- a/src/addhelper.c
+++ b/src/addhelper.c
@@ -2,6 +2,7 @@
* Beryl ADD Helper. Makes it easier to concentrate.
*
* Copyright (c) 2007 Kristian LyngstĂžl <kristian@beryl-project.org>
+ * Ported and highly modified by Patrick Niklaus <marex@beryl-project.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -120,6 +121,9 @@ static void walk_windows(CompDisplay *d)
}
}
+/* Checks if the window is dimmed and, if so, paints it with the modified
+ * paint attributes.
+ */
static Bool addhelperPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
const CompTransform *transform,
Region region, unsigned int mask)
@@ -131,18 +135,22 @@ static Bool addhelperPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
if (aw->dim)
{
+ // copy the paint attribute
WindowPaintAttrib wAttrib = *attrib;
+ // applies the lowest value
wAttrib.opacity = MIN(attrib->opacity, ad->opacity);
wAttrib.brightness = MIN(attrib->brightness, ad->brightness);
wAttrib.saturation = MIN(attrib->saturation, ad->brightness);
+ // continue painting with the modified attribute
UNWRAP(as, w->screen, paintWindow);
status = (*w->screen->paintWindow) (w, &wAttrib, transform, region, mask);
WRAP(as, w->screen, paintWindow, addhelperPaintWindow);
}
else
{
+ // the window is not dimmed, so its painted normal
UNWRAP(as, w->screen, paintWindow);
status = (*w->screen->paintWindow) (w, attrib, transform, region, mask);
WRAP(as, w->screen, paintWindow, addhelperPaintWindow);
@@ -188,6 +196,7 @@ static Bool addhelperToggle(CompDisplay * d, CompAction * ac,
return TRUE;
}
+/* Change notify for bcop */
static void addhelperDisplayOptionChanged(CompDisplay *d, CompOption *opt, AddhelperDisplayOptions num)
{
ADD_DISPLAY(d);