Change the compile-time option to disable xft double-buffering to a
authorayin <ayin>
Sat, 26 Jan 2008 14:24:42 +0000 (14:24 +0000)
committerayin <ayin>
Sat, 26 Jan 2008 14:24:42 +0000 (14:24 +0000)
runtime one.

doc/rxvt.1.pod
src/feature.h
src/init.C
src/optinc.h
src/rsinc.h
src/rxvtfont.C
src/xdefaults.C

index 23807092b69e6e41a4bd75c4183422db94ba424e..5c7ac7a1c57e1fb60a9853752e921a8a6d261ad2 100644 (file)
@@ -574,6 +574,13 @@ extensions not documented here):
 Compile I<xft>: Attempt to find a visual with the given bit depth;
 option B<-depth>.
 
+=item B<buffered:> I<boolean>
+
+Compile I<xft>: Turn on/off double-buffering for xft (default enabled).
+On some card/driver combination enabling it slightly decreases
+performance, on most it greatly helps it. The slowdown is small, so it
+should normally be enabled.
+
 =item B<geometry:> I<geom>
 
 Create the window with the specified X window geometry [default 80x24];
index fb2c9d0cf56ba51aed697251b355fbe38784ba9a..46b0b73eb4427d4699cbaa32ebb82fabe86b6a92 100644 (file)
  * report bugs, too!), but don't _expect_ them to work.
  */
 
-/*
- * Forcefully disable double-buffering for xft. On some card/driver combination
- * enabling it slightly decreases performance, on most it greatly helps it.
- * The slowdown is small, so it should normally be enabled.
- */
-/* #define FORCE_UNBUFFERED_XFT */
-
 /*
  * The cursor blink interval, in seconds.
  */
index e29824bb7c325b8d70c3f748c0cf96060349792c..d346d64508e07a663e560a3cd905584180c5b682 100644 (file)
@@ -310,6 +310,7 @@ rxvt_term::init_vars ()
   set_option (Opt_pastableTabs);
   set_option (Opt_intensityStyles);
   set_option (Opt_iso14755_52);
+  set_option (Opt_buffered);
 }
 
 static void
index 207e3bea63f446fc60dffb9877c130d1b37f7cb5..3c60b02a43d5b9a294e1425e8f7556a432e1b1aa 100644 (file)
@@ -57,4 +57,7 @@
  nodef(iso14755_52)
 #endif
  def(console,              33)
+#if XFT
+ def(buffered,             34)
+#endif
 
index 670cb9594d626f46181785c4736de7abe337a636..cfa7f1ceb97e200f1bf641165106579d4c9cfba5 100644 (file)
@@ -65,6 +65,7 @@
 #endif
 #if XFT
   def (depth)
+  def (buffered)
 #endif
 #if ENABLE_FRILLS
   def (transient_for)
index 62d52036758aba377b76aaf90f1c1aad92ffbfa3..7f2caf89d5a2a093155af804b37d936c17d54dc5 100644 (file)
@@ -1302,10 +1302,8 @@ rxvt_font_xft::draw (rxvt_drawable &d, int x, int y,
    * Maybe make buffering into a resource flag? Compile time option doesn't seems like a
    * good idea from the perspective of packaging for wide variety of user configs.
    */
-  bool buffered = bg >= Color_transparent;
-#ifdef FORCE_UNBUFFERED_XFT
-  buffered = false;
-#endif
+  bool buffered = bg >= Color_transparent
+    && term->option (Opt_buffered);
 
   // cut trailing spaces
   while (len && text [len - 1] == ' ')
index 0834024f74b24d483872f8737f0fa4d1463fdc0b..5af940d19eeb50881b88890a6f754d9d9702d8aa 100644 (file)
@@ -217,6 +217,7 @@ optList[] = {
 #endif
 #if XFT
               STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"),
+              BOOL (Rs_buffered, "buffered", NULL, Opt_buffered, 0, NULL),
 #endif
 #if ENABLE_FRILLS
               RSTRG (Rs_transient_for, "transient-for", "windowid"),