From: Basil L. Contovounesios Date: Sun, 14 Feb 2021 16:58:06 +0000 (+0000) Subject: Pacify unused function warning in xfns.c with GTK2 X-Git-Tag: emacs-28.0.90~3700 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1abf3ae854dbf8405e81680225517bbfac648964;p=emacs.git Pacify unused function warning in xfns.c with GTK2 * src/xfns.c (x_get_net_workarea, x_get_monitor_for_frame) (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback): [HAVE_XINERAMA] (x_get_monitor_attributes_xinerama) [HAVE_XRANDR] (x_get_monitor_attributes_xrandr) (x_get_monitor_attributes): Fix #ifdefs around definitions to avoid unused function warnings regardless of GTK use (bug#46509). [HAVE_XRANDR] (x_get_monitor_attributes_xrandr): Undefine RANDR13_LIBRARY after it's been used. --- diff --git a/src/xfns.c b/src/xfns.c index 481ee0e2255..d90644819b6 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4599,7 +4599,7 @@ On MS Windows, this just returns nil. */) return Qnil; } -#if !defined USE_GTK || !defined HAVE_GTK3 +#if !(defined USE_GTK && defined HAVE_GTK3) /* Store the geometry of the workarea on display DPYINFO into *RECT. Return false if and only if the workarea information cannot be @@ -4662,6 +4662,9 @@ x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect) return result; } +#endif /* !(USE_GTK && HAVE_GTK3) */ + +#ifndef USE_GTK /* Return monitor number where F is "most" or closest to. */ static int @@ -4877,6 +4880,8 @@ x_get_monitor_attributes_xrandr (struct x_display_info *dpyinfo) pxid = XRRGetOutputPrimary (dpy, dpyinfo->root_window); #endif +#undef RANDR13_LIBRARY + for (i = 0; i < n_monitors; ++i) { XRROutputInfo *info = XRRGetOutputInfo (dpy, resources,