emacs-diffs
[Top][All Lists]
Advanced

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

master 7c16f69101: Clean up some of the X extension related code


From: Po Lu
Subject: master 7c16f69101: Clean up some of the X extension related code
Date: Sat, 22 Jan 2022 20:15:41 -0500 (EST)

branch: master
commit 7c16f691011deb0843ea8d7c8324aca034cbd56c
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Clean up some of the X extension related code
    
    * src/image.c (Fimage_transforms_p): Remove unused variables.
    * src/xterm.c (x_probe_xfixes_extension):
    (x_term_init): Probe for xfixes during terminal initialization
    instead.
    * src/xterm.h (struct x_display_info): New fields for xfixes
    support.
---
 src/image.c |  2 --
 src/xterm.c | 22 ++++++++++++++++++++--
 src/xterm.h |  6 ++++++
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/src/image.c b/src/image.c
index ce9af2dd67..7ee595297f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11195,8 +11195,6 @@ The list of capabilities can include one or more of the 
following:
   || defined (HAVE_HAIKU)
       return list2 (Qscale, Qrotate90);
 # elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER)
-      int event_basep, error_basep;
-
       if (FRAME_DISPLAY_INFO (f)->xrender_supported_p)
        return list2 (Qscale, Qrotate90);
 # elif defined (HAVE_NTGUI)
diff --git a/src/xterm.c b/src/xterm.c
index 36e0045d2e..2a4ea883bc 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -14920,8 +14920,12 @@ static bool
 x_probe_xfixes_extension (Display *dpy)
 {
 #ifdef HAVE_XFIXES
-  int major, minor;
-  return XFixesQueryVersion (dpy, &major, &minor) && major >= 4;
+  struct x_display_info *info
+    = x_display_info_for_display (dpy);
+
+  return (info
+         && info->xfixes_supported_p
+         && info->xfixes_major >= 4);
 #else
   return false;
 #endif /* HAVE_XFIXES */
@@ -15431,6 +15435,20 @@ x_term_init (Lisp_Object display_name, char 
*xrm_option, char *resource_name)
     }
 #endif
 
+#ifdef HAVE_XFIXES
+  int xfixes_event_base, xfixes_error_base;
+  dpyinfo->xfixes_supported_p
+    = XFixesQueryExtension (dpyinfo->display, &xfixes_event_base,
+                           &xfixes_error_base);
+
+  if (dpyinfo->xfixes_supported_p)
+    {
+      if (!XFixesQueryVersion (dpyinfo->display, &dpyinfo->xfixes_major,
+                              &dpyinfo->xfixes_minor))
+       dpyinfo->xfixes_supported_p = false;
+    }
+#endif
+
 #if defined USE_CAIRO || defined HAVE_XFT
   {
     /* If we are using Xft, the following precautions should be made:
diff --git a/src/xterm.h b/src/xterm.h
index 26b2851590..a4ad57edda 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -546,6 +546,12 @@ struct x_display_info
   int xrender_major;
   int xrender_minor;
 #endif
+
+#ifdef HAVE_XFIXES
+  bool xfixes_supported_p;
+  int xfixes_major;
+  int xfixes_minor;
+#endif
 };
 
 #ifdef HAVE_X_I18N



reply via email to

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