okay, bring back xrandr < 1.4 compat for ecore_x_randr_output_name_get
authorMike Blumenkrantz <zmike@samsung.com>
Tue, 21 Jan 2014 21:07:38 +0000 (16:07 -0500)
committerMike Blumenkrantz <zmike@samsung.com>
Tue, 21 Jan 2014 21:07:38 +0000 (16:07 -0500)
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

configure.ac
src/lib/ecore_x/xlib/ecore_x_randr.c

index 2d2e3773dca97adf2b5db2d336a0af4f72de68a8..373ea6dc5361db7fa1e04e8d454c7931b1405b49 100644 (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])
index b4777772a3e79149a7cbac92b5dbfa76ecf73319..db1f10968c0ca50bff3eb2c87e3b2c179cc7dfdb 100644 (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 */