emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117352: Do not ask for XRender extension each time


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r117352: Do not ask for XRender extension each time XFT font is opened.
Date: Mon, 16 Jun 2014 08:50:29 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117352
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2014-06-16 12:49:09 +0400
message:
  Do not ask for XRender extension each time XFT font is opened.
  * xftfont.c (xftfont_open): Move call to XRenderQueryExtension ...
  * xterm.c (x_term_init) [HAVE_XFT]: ... to here.  Adjust comment.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xftfont.c                  xftfont.c-20091113204419-o5vbwnq5f7feedwu-8548
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-06-15 00:34:22 +0000
+++ b/src/ChangeLog     2014-06-16 08:49:09 +0000
@@ -1,3 +1,9 @@
+2014-06-16  Dmitry Antipov  <address@hidden>
+
+       Do not ask for XRender extension each time XFT font is opened.
+       * xftfont.c (xftfont_open): Move call to XRenderQueryExtension ...
+       * xterm.c (x_term_init) [HAVE_XFT]: ... to here.  Adjust comment.
+
 2014-06-15  Glenn Morris  <address@hidden>
 
        * Makefile.in: Use `make -C' rather than `cd && make' throughout.

=== modified file 'src/xftfont.c'
--- a/src/xftfont.c     2014-06-10 03:32:36 +0000
+++ b/src/xftfont.c     2014-06-16 08:49:09 +0000
@@ -322,16 +322,6 @@
 
 
   block_input ();
-  /* Make sure that the Xrender extension is added before the Xft one.
-     Otherwise, the close-display hook set by Xft is called after the
-     one for Xrender, and the former tries to re-add the latter.  This
-     results in inconsistency of internal states and leads to X
-     protocol error when one reconnects to the same X server.
-     (Bug#1696)  */
-  {
-    int event_base, error_base;
-    XRenderQueryExtension (display, &event_base, &error_base);
-  }
 
   /* Substitute in values from X resources and XftDefaultSet.  */
   XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2014-06-10 04:55:03 +0000
+++ b/src/xterm.c       2014-06-16 08:49:09 +0000
@@ -37,6 +37,11 @@
 #include <X11/extensions/Xfixes.h>
 #endif
 
+/* Using Xft implies that XRender is available.  */
+#ifdef HAVE_XFT
+#include <X11/extensions/Xrender.h>
+#endif
+
 /* Load sys/types.h if not already loaded.
    In some systems loading it twice is suicidal.  */
 #ifndef makedev
@@ -10086,14 +10091,27 @@
 
 #ifdef HAVE_XFT
   {
-    /* If we are using Xft, check dpi value in X resources.
-       It is better we use it as well, since Xft will use it, as will all
-       Gnome applications.  If our real DPI is smaller or larger than the
-       one Xft uses, our font will look smaller or larger than other
-       for other applications, even if it is the same font name (monospace-10
-       for example).  */
-    char *v = XGetDefault (dpyinfo->display, "Xft", "dpi");
+    /* If we are using Xft, the following precautions should be made:
+
+       1. Make sure that the Xrender extension is added before the Xft one.
+       Otherwise, the close-display hook set by Xft is called after the one
+       for Xrender, and the former tries to re-add the latter.  This results
+       in inconsistency of internal states and leads to X protocol error when
+       one reconnects to the same X server (Bug#1696).
+
+       2. Check dpi value in X resources.  It is better we use it as well,
+       since Xft will use it, as will all Gnome applications.  If our real DPI
+       is smaller or larger than the one Xft uses, our font will look smaller
+       or larger than other for other applications, even if it is the same
+       font name (monospace-10 for example).  */
+
+    int event_base, error_base;
+    char *v;
     double d;
+
+    XRenderQueryExtension (dpyinfo->display, &event_base, &error_base);
+
+    v = XGetDefault (dpyinfo->display, "Xft", "dpi");    
     if (v != NULL && sscanf (v, "%lf", &d) == 1)
       dpyinfo->resy = dpyinfo->resx = d;
   }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]