summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2012-09-12 10:52:52 +0800
committerRichard Grenville <pyxlcy@gmail.com>2012-09-12 10:52:52 +0800
commit1f271c29531850560e1e50eec3dece70d2ee1dfd (patch)
tree46f56ef5833eb326ac6ca8f6a7a685026c18cced /compton.h
parent7ab11dfa666ee9341ddd0eb82e3e6d0117e42e8f (diff)
downloadtdebase-1f271c29531850560e1e50eec3dece70d2ee1dfd.tar.gz
tdebase-1f271c29531850560e1e50eec3dece70d2ee1dfd.zip
Feature: Issue #2: Support dim inactive windows
- Add a switch --inactive-dim that dims inactive windows. - The window dimming feature is implemented in a pretty ugly way. Improve it if possible.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/compton.h b/compton.h
index 451ea3d53..ea906969d 100644
--- a/compton.h
+++ b/compton.h
@@ -108,6 +108,8 @@ typedef struct _win {
opacity_t opacity;
/// Cached value of opacity window attribute.
opacity_t opacity_prop;
+ /// Whether the window is to be dimmed.
+ Bool dim;
wintype window_type;
/// Whether the window is focused.
Bool focused;
@@ -363,6 +365,8 @@ void set_opacity(Display *dpy, win *w, opacity_t opacity);
void calc_opacity(Display *dpy, win *w, Bool refetch_prop);
+void calc_dim(Display *dpy, win *w);
+
static void
add_win(Display *dpy, Window id, Window prev, Bool override_redirect);
@@ -488,6 +492,17 @@ inline static XserverRegion copy_region(Display *dpy,
return region;
}
+/**
+ * Add a window to damaged area.
+ *
+ * @param dpy display in use
+ * @param w struct _win element representing the window
+ */
+static inline void add_damage_win(Display *dpy, win *w) {
+ if (w->extents)
+ add_damage(dpy, copy_region(dpy, w->extents));
+}
+
inline static void
ev_handle(XEvent *ev);