summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2012-12-14 20:32:46 +0800
committerRichard Grenville <[email protected]>2012-12-14 20:32:46 +0800
commit64a9b80f3b29af29c4b8fc7e6981ac1f321f768c (patch)
tree168b6244231fb0dd3842bba21dcd3ddcb322f15b /compton.h
parent844a51b45a7596c4dcf84068c0f39ea994248ceb (diff)
downloadtdebase-64a9b80f3b29af29c4b8fc7e6981ac1f321f768c.tar.gz
tdebase-64a9b80f3b29af29c4b8fc7e6981ac1f321f768c.zip
Feature #69: Blur window background
- Add window background blur support (--blur-background & --blur-background-frame), with X Render convolution filter. The performance sucks. The performance when the window is opaque but frame is transparent could be improved, but there are two possible ways and I'm hesitating. - Known issue: The blurring effect looks very ungraceful during fading. I could partially fix the problem, but it probably isn't easy to fix it completely.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/compton.h b/compton.h
index 16272e6f5..8aecaa762 100644
--- a/compton.h
+++ b/compton.h
@@ -116,6 +116,10 @@
#define US_PER_SEC 1000000L
#define MS_PER_SEC 1000
+#define XRFILTER_CONVOLUTION "convolution"
+#define XRFILTER_GUASSIAN "gaussian"
+#define XRFILTER_BINOMIAL "binomial"
+
// Window flags
// Window size is changed
@@ -326,6 +330,11 @@ typedef struct {
bool inactive_dim_fixed;
/// Step for pregenerating alpha pictures. 0.01 - 1.0.
double alpha_step;
+ /// Whether to blur background of semi-transparent / ARGB windows.
+ bool blur_background;
+ /// Whether to blur background when the window frame is not opaque.
+ /// Implies blur_background.
+ bool blur_background_frame;
// === Focus related ===
/// Consider windows of specific types to be always focused.
@@ -519,6 +528,8 @@ typedef struct {
#endif
/// Whether X DBE extension exists.
bool dbe_exists;
+ /// Whether X Render convolution filter exists.
+ bool xrfilter_convolution_exists;
// === Atoms ===
/// Atom of property <code>_NET_WM_OPACITY</code>.
@@ -779,6 +790,22 @@ static int
should_ignore(session_t *ps, unsigned long sequence);
/**
+ * Return the painting target window.
+ */
+static inline Window
+get_tgt_window(session_t *ps) {
+ return ps->o.paint_on_overlay ? ps->overlay: ps->root;
+}
+
+/**
+ * Reset filter on a <code>Picture</code>.
+ */
+static inline void
+xrfilter_reset(session_t *ps, Picture p) {
+ XRenderSetPictureFilter(ps->dpy, p, "Nearest", NULL, 0);
+}
+
+/**
* Subtract two unsigned long values.
*
* Truncate to 0 if the result is negative.