okay, bring back xrandr < 1.4 compat for ecore_x_randr_output_name_get

apparently I read the commit order wrong and this fix went in for 1.4.0, not 1.3.2, which means anyone who has 1.3.2 has been having lots of fun crashes for the past 24 hours
This commit is contained in:
Mike Blumenkrantz 2014-01-21 16:07:38 -05:00
parent 8cbd7c1622
commit 052fc85cd3
2 changed files with 12 additions and 7 deletions

View File

@ -2875,9 +2875,7 @@ if test "x${want_x11_xlib}" = "xyes" ; then
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])

View File

@ -2206,10 +2206,17 @@ ecore_x_randr_output_name_get(Ecore_X_Window root, Ecore_X_Randr_Output output,
{
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 */