diff options
author | Richard Grenville <pyxlcy@gmail.com> | 2012-09-12 10:52:52 +0800 |
---|---|---|
committer | Richard Grenville <pyxlcy@gmail.com> | 2012-09-12 10:52:52 +0800 |
commit | 1f271c29531850560e1e50eec3dece70d2ee1dfd (patch) | |
tree | 46f56ef5833eb326ac6ca8f6a7a685026c18cced /compton.h | |
parent | 7ab11dfa666ee9341ddd0eb82e3e6d0117e42e8f (diff) | |
download | tdebase-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.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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); |