summaryrefslogtreecommitdiffstats
path: root/compton.c
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-04-27 17:34:42 +0800
committerRichard Grenville <[email protected]>2013-04-27 17:44:10 +0800
commit19471a428959f681f1f4c14a46e6dc01dd212ad4 (patch)
tree2abf513f8b0b7cb55530dfcc033c5a7483ca0318 /compton.c
parent5775cefe97e12c7786871b5efc4e3658c97309e5 (diff)
downloadtdebase-19471a428959f681f1f4c14a46e6dc01dd212ad4.tar.gz
tdebase-19471a428959f681f1f4c14a46e6dc01dd212ad4.zip
Bug fix: Fix --resize-damage
- Fix --resize-damage. I forgot to shrink the painting region back when actually copying to destination. - Include extra pixels around the blur texture to avoid some possible small issues, if --resize-damage is positive. - Known issue: Line artifacts may still appear with --dbe (X Render backend) or --glx-swap-method (GLX backend). I doubt if there's way to fix this without very inefficient mechanisms.
Diffstat (limited to 'compton.c')
-rw-r--r--compton.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/compton.c b/compton.c
index cfd773c69..d5989d668 100644
--- a/compton.c
+++ b/compton.c
@@ -1597,7 +1597,10 @@ rebuild_screen_reg(session_t *ps) {
}
static void
-paint_all(session_t *ps, XserverRegion region, win *t) {
+paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t) {
+ if (!region_real)
+ region_real = region;
+
#ifdef DEBUG_REPAINT
static struct timespec last_paint = { 0 };
#endif
@@ -1645,7 +1648,8 @@ paint_all(session_t *ps, XserverRegion region, win *t) {
}
#endif
- XFixesSetPictureClipRegion(ps->dpy, ps->tgt_picture, 0, 0, region);
+ if (BKEND_XRENDER == ps->o.backend)
+ XFixesSetPictureClipRegion(ps->dpy, ps->tgt_picture, 0, 0, region_real);
#ifdef MONITOR_REPAINT
switch (ps->o.backend) {
@@ -1820,7 +1824,7 @@ paint_all(session_t *ps, XserverRegion region, win *t) {
#ifdef CONFIG_VSYNC_OPENGL
case BKEND_GLX:
if (ps->o.glx_use_copysubbuffermesa)
- glx_swap_copysubbuffermesa(ps, region);
+ glx_swap_copysubbuffermesa(ps, region_real);
else
glXSwapBuffers(ps->dpy, get_tgt_window(ps));
break;
@@ -6551,7 +6555,7 @@ session_run(session_t *ps) {
t = paint_preprocess(ps, ps->list);
if (ps->redirected)
- paint_all(ps, None, t);
+ paint_all(ps, None, None, t);
// Initialize idling
ps->idling = false;
@@ -6587,10 +6591,13 @@ session_run(session_t *ps) {
if (!ps->redirected)
free_region(ps, &ps->all_damage);
+ XserverRegion all_damage_orig = None;
+ if (ps->o.resize_damage > 0)
+ all_damage_orig = copy_region(ps, ps->all_damage);
resize_region(ps, ps->all_damage, ps->o.resize_damage);
if (ps->all_damage && !is_region_empty(ps, ps->all_damage, NULL)) {
static int paint = 0;
- paint_all(ps, ps->all_damage, t);
+ paint_all(ps, ps->all_damage, all_damage_orig, t);
ps->reg_ignore_expire = false;
paint++;
if (ps->o.benchmark && paint >= ps->o.benchmark)
@@ -6598,6 +6605,7 @@ session_run(session_t *ps) {
XSync(ps->dpy, False);
ps->all_damage = None;
}
+ free_region(ps, &all_damage_orig);
if (ps->idling)
ps->fade_time = 0L;