ECORE_CHECK_X_EXTENSION([Xtest], [XTest.h], [Xtst], [XTestFakeKeyEvent])
ECORE_CHECK_X_EXTENSION([Xss], [scrnsaver.h], [Xss], [XScreenSaverSelectInput])
- if test echo "$ECORE_X_LIBS" | grep -q Xrandr ; then
- PKG_CHECK_EXISTS([xrandr > 1.3.1], [], [AC_MSG_ERROR([Xrandr >= 1.3.1 required])])
- fi
+ PKG_CHECK_EXISTS([xrandr > 1.3.2], [AC_DEFINE([XRANDR_GOOD], [1], [good xrandr])], [])
if test "${want_xpresent}" = "yes"; then
ECORE_CHECK_X_EXTENSION([Xpresent], [Xpresent.h], [Xpresent], [XPresentQueryExtension])
{
if (info->name)
{
- ret = malloc(info->nameLen + 1);
- memcpy(ret, info->name, info->nameLen);
- ret[info->nameLen] = 0;
- if (len) *len = info->nameLen;
+ size_t s;
+#ifdef XRANDR_GOOD
+ s = info->nameLen;
+#else
+ /* pre 1.4.0 does not fill in info->nameLen */
+ s = strlen(info->name);
+#endif
+ ret = malloc(s + 1);
+ memcpy(ret, info->name, s);
+ ret[s] = 0;
+ if (len) *len = s;
}
/* free the output info */