]> git.eshelyaron.com Git - emacs.git/commitdiff
Stop quering for Xinerama inside x_get_monitor_attributes
authorPo Lu <luangruo@yahoo.com>
Sun, 13 Feb 2022 03:00:52 +0000 (11:00 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 13 Feb 2022 03:00:52 +0000 (11:00 +0800)
* src/xfns.c (x_get_monitor_attributes): Remove Xinerama check
and use xinerama_supported_p instead.
* src/xterm.c (x_term_init): Set `xinerama_supported_p'
* src/xterm.h (struct x_display_info): New field
`xinerama_supported_p'.

src/xfns.c
src/xterm.c
src/xterm.h

index 6d4a4f47cfcadb6e502b93986fc962f1e97c4633..94f215eaf8b5d167b33b2a63114e673d52990771 100644 (file)
@@ -5720,10 +5720,7 @@ x_get_monitor_attributes (struct x_display_info *dpyinfo)
 #ifdef HAVE_XINERAMA
   if (NILP (attributes_list))
     {
-      int xin_event_base, xin_error_base;
-      bool xin_ok = false;
-      xin_ok = XineramaQueryExtension (dpy, &xin_event_base, &xin_error_base);
-      if (xin_ok && XineramaIsActive (dpy))
+      if (dpyinfo->xinerama_supported_p && XineramaIsActive (dpy))
         attributes_list = x_get_monitor_attributes_xinerama (dpyinfo);
     }
 #endif /* HAVE_XINERAMA */
index e45d3e8f07a0536fae7eb8c90ecc2e79321d3421..50b7c9a606706044958e1b1138153d536ad644dc 100644 (file)
@@ -126,6 +126,10 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <X11/extensions/sync.h>
 #endif
 
+#ifdef HAVE_XINERAMA
+#include <X11/extensions/Xinerama.h>
+#endif
+
 /* Load sys/types.h if not already loaded.
    In some systems loading it twice is suicidal.  */
 #ifndef makedev
@@ -15937,6 +15941,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
       dpyinfo->xsync_supported_p = false;
   }
 #endif
+
+#ifdef HAVE_XINERAMA
+  int xin_event_base, xin_error_base;
+  dpyinfo->xinerama_supported_p
+    = XineramaQueryExtension (dpy, &xin_event_base, &xin_error_base);
+#endif
+
   /* See if a private colormap is requested.  */
   if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen))
     {
index 3a69c02879766d31dbe7669144b8e68b01ac5a81..99c86ced56caa1b88ab2eee30f808f63e3a27642 100644 (file)
@@ -579,6 +579,10 @@ struct x_display_info
   int xsync_major;
   int xsync_minor;
 #endif
+
+#ifdef HAVE_XINERAMA
+  bool xinerama_supported_p;
+#endif
 };
 
 #ifdef HAVE_X_I18N