summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/trailfocus2.c
diff options
context:
space:
mode:
authorkristian <kristian@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-17 14:23:13 +0000
committerkristian <kristian@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-17 14:23:13 +0000
commit5f37e20ff9c11fd46a820fa3ded7fe446c7af034 (patch)
tree37696ce92089812a0379fffdf3dd49225e781c33 /beryl-plugins/src/trailfocus2.c
parente0d49685683aad999072854f648abfb39871bde9 (diff)
downloadmarex-dev-5f37e20ff9c11fd46a820fa3ded7fe446c7af034.tar.gz
marex-dev-5f37e20ff9c11fd46a820fa3ded7fe446c7af034.tar.bz2
core:
- Adjust paint-locking and bring the function names in line with the rest of core. plugins: - opacify, trailfocus2, move: Better utilize the paint-system provided. - state: Provide better locking and resetting. git-svn-id: file:///beryl/trunk@2771 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/trailfocus2.c')
-rw-r--r--beryl-plugins/src/trailfocus2.c55
1 files changed, 15 insertions, 40 deletions
diff --git a/beryl-plugins/src/trailfocus2.c b/beryl-plugins/src/trailfocus2.c
index a2037dc..ebbbb09 100644
--- a/beryl-plugins/src/trailfocus2.c
+++ b/beryl-plugins/src/trailfocus2.c
@@ -22,11 +22,6 @@
* Trailfocus modifies the opacity, brightness and saturation on a window
* based on when it last had focus.
*
- * TODO:
- * - Binding for ignore-toggeling? This should not be necesarry with
- * the new paint-attrib system (hopefully).
- * - Compare behavior with the old trailfocus.
- * - Use the new paint-attrib-changing method when it is defined.
*/
#include <stdlib.h>
@@ -104,7 +99,7 @@ static Bool is_trailfocus_window(TrailfocusScreen * ts, CompWindow * w)
{
if (!(w->type & ts->wMask))
return False;
- if (w->defaultPaintLock || w->paint.lock)
+ if (w->defaultPaintLock)
return False;
if (ts->opt[SOPT_IGNORE_SKIPTASKBAR].value.b
@@ -117,52 +112,32 @@ static Bool is_trailfocus_window(TrailfocusScreen * ts, CompWindow * w)
return True;
}
-/* The set_[opacity|brightness|saturation] functions of
- * trailfocus modifies the atoms if necesarry. These modify the actual
- * atom, and also do not check if the window supplied is valid.
- * FIXME: These are not permanent. We should not have to change the atom.
+/* The set_[opacity|brightness|saturation] functions of the
+ * respective values. These set the default values, see
+ * paint.c or beryl.h for description of how
+ * default-vs-permanant paint attributes work.
*/
-static void set_opacity(CompWindow * w, int opacity)
+static inline void set_opacity(CompWindow * w, int opacity)
{
- if (w->paint.opacity == opacity && w->opacity == opacity)
- return;
- if(set_default_window_opacity(w, opacity, PL_NO_LOCK))
- set_window_opacity(w, opacity, PL_NO_LOCK);
+ setDefaultWindowOpacity(w, opacity, PL_NO_LOCK);
}
-static void set_brightness(CompWindow * w, int brightness)
+static inline void set_brightness(CompWindow * w, int brightness)
{
- if (w->paint.brightness == brightness && w->brightness == brightness)
- return;
- if(set_default_window_brightness(w, brightness, PL_NO_LOCK))
- set_window_brightness(w, brightness, PL_NO_LOCK);
+ setDefaultWindowBrightness(w, brightness, PL_NO_LOCK);
}
-static void set_saturation(CompWindow * w, int sat)
+static inline void set_saturation(CompWindow * w, int sat)
{
- if (w->paint.saturation == sat && w->saturation == sat)
- return;
- if(set_default_window_saturation(w, sat, PL_NO_LOCK))
- set_window_saturation(w, sat, PL_NO_LOCK);
+ setDefaultWindowSaturation(w, sat, PL_NO_LOCK);
}
-/* Resets a window's paint attribute when we're bailing out. Ideally this should
- * reset to the atom, we're waiting for a proper paint-backend. In the meanwhile
- * we're doing 0xFFFF. This is meant for plugin unload or when we are suddenly
- * no longer handeling a window.
- * FIXME: These are NOT PERMANENT AND NOT CORRECT. This is merely a
- * place-holder until a more proper system has been put in place.
+/* Resets a window's paint attribute when we're bailing out.
+ *
*/
-static void bail_out_window(CompWindow * w)
+static inline void bail_out_window(CompWindow * w)
{
- if (UNLIKELY(!w))
- return;
- set_window_bailout_opacity(w, PL_NO_LOCK);
- set_window_bailout_saturation(w, PL_NO_LOCK);
- set_window_bailout_brightness(w, PL_NO_LOCK);
- reset_window_opacity(w, PL_NO_LOCK);
- reset_window_saturation(w, PL_NO_LOCK);
- reset_window_brightness(w, PL_NO_LOCK);
+ setWindowBailout(w, PL_NO_LOCK);
}
/* Meant for unload. Reset all windows handled by us. */