]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up some of the X extension related code
authorPo Lu <luangruo@yahoo.com>
Sun, 23 Jan 2022 01:14:16 +0000 (09:14 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 23 Jan 2022 01:14:16 +0000 (09:14 +0800)
* 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
src/xterm.c
src/xterm.h

index ce9af2dd677b0b509859c94b7ceb8ac60d26fd77..7ee595297fad564da06390b2a30cca2a25d90e19 100644 (file)
@@ -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)
index 36e0045d2ed1b29b1459fc6330d3d95a76f78adc..2a4ea883bc1bc20c379dac72e75e357e4fcafca7 100644 (file)
@@ -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:
index 26b2851590ddd6dad126ca9315c84d05968f17df..a4ad57eddaaf5dc6b6fe181581101e05e3a60d8b 100644 (file)
@@ -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