summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2014-05-16 15:18:17 +0800
committerRichard Grenville <pyxlcy@gmail.com>2014-05-16 15:18:17 +0800
commit0fa155f566d7d1d290e4b922859410b5f76f9dfa (patch)
tree817e1582b3e197c0feeed7cc6ef7afa21bbbb7ae /compton.h
parent12225bcad2ad98b011a809ec882452b9d0242caa (diff)
downloadtdebase-0fa155f566d7d1d290e4b922859410b5f76f9dfa.tar.gz
tdebase-0fa155f566d7d1d290e4b922859410b5f76f9dfa.zip
Feature: #183 custom window shader & #193 --no-fading-destroyed-argb
- Add --glx-fshader-win, which specifies a custom fragment shader for painting windows. compton-default-fshader-win.glsl is the shader with default behavior, and compton-fake-transparency-fshader-win.glsl provides a template of fake transparency. (#183) - Add --force-win-blend to force all windows to be painted with blending. - Add --no-fading-destroyed-argb, as a workaround of bugs in some WMs. (#193)
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/compton.h b/compton.h
index 7eff0a390..524e81ed9 100644
--- a/compton.h
+++ b/compton.h
@@ -675,20 +675,37 @@ static win *
paint_preprocess(session_t *ps, win *list);
static void
-render(session_t *ps, int x, int y, int dx, int dy, int wid, int hei,
+render_(session_t *ps, int x, int y, int dx, int dy, int wid, int hei,
double opacity, bool argb, bool neg,
Picture pict, glx_texture_t *ptex,
- XserverRegion reg_paint, const reg_data_t *pcache_reg);
+ XserverRegion reg_paint, const reg_data_t *pcache_reg
+#ifdef CONFIG_VSYNC_OPENGL_GLSL
+ , const glx_prog_main_t *pprogram
+#endif
+ );
+
+#ifdef CONFIG_VSYNC_OPENGL_GLSL
+#define \
+ render(ps, x, y, dx, dy, wid, hei, opacity, argb, neg, pict, ptex, reg_paint, pcache_reg, pprogram) \
+ render_(ps, x, y, dx, dy, wid, hei, opacity, argb, neg, pict, ptex, reg_paint, pcache_reg, pprogram)
+#else
+#define \
+ render(ps, x, y, dx, dy, wid, hei, opacity, argb, neg, pict, ptex, reg_paint, pcache_reg, pprogram) \
+ render_(ps, x, y, dx, dy, wid, hei, opacity, argb, neg, pict, ptex, reg_paint, pcache_reg)
+#endif
static inline void
-win_render(session_t *ps, win *w, int x, int y, int wid, int hei, double opacity, XserverRegion reg_paint, const reg_data_t *pcache_reg, Picture pict) {
+win_render(session_t *ps, win *w, int x, int y, int wid, int hei,
+ double opacity, XserverRegion reg_paint, const reg_data_t *pcache_reg,
+ Picture pict) {
const int dx = (w ? w->a.x: 0) + x;
const int dy = (w ? w->a.y: 0) + y;
- const bool argb = (w && w->mode == WMODE_ARGB);
+ const bool argb = (w && (WMODE_ARGB == w->mode || ps->o.force_win_blend));
const bool neg = (w && w->invert_color);
render(ps, x, y, dx, dy, wid, hei, opacity, argb, neg,
- pict, (w ? w->paint.ptex: ps->root_tile_paint.ptex), reg_paint, pcache_reg);
+ pict, (w ? w->paint.ptex: ps->root_tile_paint.ptex),
+ reg_paint, pcache_reg, (w ? &ps->o.glx_prog_win: NULL));
}
static inline void