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.
This commit is contained in:
Basil L. Contovounesios 2021-02-14 16:58:06 +00:00
parent 76220fc3fc
commit 1abf3ae854

View file

@ -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,