From c66ba97d67eac72e9b0b32599b5e81318161f23e Mon Sep 17 00:00:00 2001 From: sasha Date: Fri, 4 Jan 2008 21:25:57 +0000 Subject: [PATCH] background redrawing timing tuning --- src/background.C | 4 ++++ src/background.h | 2 +- src/main.C | 13 ++++--------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/background.C b/src/background.C index 3270fccb..7a290545 100644 --- a/src/background.C +++ b/src/background.C @@ -98,6 +98,7 @@ bgPixmap_t::bgPixmap_t () #endif flags = 0; pixmap = None; + valid_since = invalid_since = 0; } void @@ -1240,6 +1241,9 @@ bgPixmap_t::render () apply (); + XSync (target->dpy, False); + valid_since = ev::now (); + TIMING_TEST_PRINT_RESULT (tp); return true; diff --git a/src/background.h b/src/background.h index bd29f327..41015ca8 100644 --- a/src/background.h +++ b/src/background.h @@ -98,7 +98,7 @@ struct bgPixmap_t unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */ # endif - double invalid_since; + double invalid_since, valid_since; Pixmap pixmap; unsigned int pmap_width, pmap_height; diff --git a/src/main.C b/src/main.C index c6d8775e..376304ca 100644 --- a/src/main.C +++ b/src/main.C @@ -1718,17 +1718,12 @@ rxvt_term::update_background () bgPixmap.invalidate (); - ev_tstamp refresh; + ev_tstamp to_wait = 0.5 - (ev::now () - bgPixmap.valid_since); - if (!bgPixmap.need_client_side_rendering ()) - refresh = .05; - else if (bgPixmap.flags & bgPixmap_t::blurNeeded) - /* no chance of real time refresh if we are bluring! */ - refresh = .50; + if ( to_wait <= 0. ) + bgPixmap.render (); else - refresh = .07; - - update_background_ev.start (refresh); + update_background_ev.start (to_wait); } void -- 2.34.1