From fcf80d7e62edb5a5ac0da346ac4d189671be2abf Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 25 May 2022 08:49:14 +0800 Subject: [PATCH] Fix compilation on GTK when Xrandr is not present * src/xterm.c (x_term_init): Make term always present on GTK. --- src/xterm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 261fa807d0c..3fe81078819 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -24679,17 +24679,20 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) ; #endif -#ifdef HAVE_XRANDR +#if defined HAVE_XRANDR || defined USE_GTK Lisp_Object term; -#ifndef USE_GTK - dpyinfo->last_monitor_attributes_list = Qnil; + XSETTERMINAL (term, terminal); #endif + +#ifdef HAVE_XRANDR dpyinfo->xrandr_supported_p = XRRQueryExtension (dpy, &dpyinfo->xrandr_event_base, &dpyinfo->xrandr_error_base); - XSETTERMINAL (term, terminal); +#ifndef USE_GTK + dpyinfo->last_monitor_attributes_list = Qnil; +#endif if (dpyinfo->xrandr_supported_p) { -- 2.39.2