From f79bf997cf47559f97cec96c2ce39cc98141b2ec Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Mon, 27 Jun 2005 00:07:13 +0000 Subject: Sun Jun 26 21:05:03 2005 Michael Jennings (mej) Attempt to fix autogen.sh for Gentoo and Solaris. Detect and avoid E 0.17 faking E 0.16.x's IPC mechanisms. ---------------------------------------------------------------------- SVN revision: 15535 --- ChangeLog | 6 ++++++ autogen.sh | 8 ++++---- src/e.c | 27 +++++++++++++++++++++++++-- src/startup.c | 1 + src/startup.h | 1 + 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4423b44..fa243d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5403,3 +5403,9 @@ Tue Jun 14 15:36:09 2005 Michael Jennings (mej) Added SSE2 support patch thanks to Tres Melton and John Ellson . ---------------------------------------------------------------------- +Sun Jun 26 21:05:03 2005 Michael Jennings (mej) + +Attempt to fix autogen.sh for Gentoo and Solaris. + +Detect and avoid E 0.17 faking E 0.16.x's IPC mechanisms. +---------------------------------------------------------------------- diff --git a/autogen.sh b/autogen.sh index c900c4f..c494424 100755 --- a/autogen.sh +++ b/autogen.sh @@ -49,13 +49,13 @@ done export LIBTOOLIZE ACLOCAL AUTOCONF AUTOHEADER AUTOMAKE # Check for existing libast.m4 we can use. Use the local one if not. -if test ! -f "`$ACLOCAL --print-ac-dir`/libast.m4"; then - ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS" -fi +#if test ! -f "`$ACLOCAL --print-ac-dir`/libast.m4"; then +# ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS" +#fi # Run the stuff. (set -x && $LIBTOOLIZE -c -f) -(set -x && $ACLOCAL $ACLOCAL_FLAGS) +(set -x && $ACLOCAL -I . $ACLOCAL_FLAGS) (set -x && $AUTOCONF) (set -x && $AUTOHEADER) (set -x && $AUTOMAKE -a -c) diff --git a/src/e.c b/src/e.c index c2b62a1..ed84f0f 100644 --- a/src/e.c +++ b/src/e.c @@ -64,7 +64,6 @@ check_for_enlightenment(void) Window enl_ipc_get_win(void) { - unsigned char *str = NULL; Atom prop; unsigned long num, after; @@ -75,7 +74,7 @@ enl_ipc_get_win(void) D_ENL(("Searching for IPC window.\n")); - if (props[PROP_ENL_COMMS] == None) { + if ((props[PROP_ENL_COMMS] == None) || (props[PROP_ENL_VERSION] == None)) { D_ENL((" -> Enlightenment is not running. You lose!\n")); return None; } @@ -84,6 +83,30 @@ enl_ipc_get_win(void) sscanf((char *) str, "%*s %x", (unsigned int *) &ipc_win); XFree(str); } + if (ipc_win != None) { + XGetWindowProperty(Xdisplay, Xroot, props[PROP_ENL_VERSION], 0, 14, False, AnyPropertyType, + &prop, &format, &num, &after, &str); + if (str) { + char *ver, *tmp; + + tmp = strchr((char *) str, ' '); + if (tmp) { + ver = tmp + 1; + tmp = strchr((char *) ver, ' '); + if (tmp) { + *tmp = 0; + } + + /* Make sure the version string is within the acceptable range. */ + if (SPIF_CMP_IS_LESS(spiftool_version_compare(SPIF_CAST(charptr) str, SPIF_CAST(charptr) "0.16.4")) + || SPIF_CMP_IS_GREATER(spiftool_version_compare(SPIF_CAST(charptr) str, SPIF_CAST(charptr) "0.16.999"))) { + D_ENL((" -> IPC version string \"%s\" out of range. I'll have to ignore it.\n")); + ipc_win = None; + } + } + XFree(str); + } + } if (ipc_win != None) { if (!XGetGeometry (Xdisplay, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) { diff --git a/src/startup.c b/src/startup.c index f993b14..8fb6f78 100644 --- a/src/startup.c +++ b/src/startup.c @@ -146,6 +146,7 @@ eterm_bootstrap(int argc, char *argv[]) props[PROP_SELECTION_INCR] = XInternAtom(Xdisplay, "INCR", False); props[PROP_SELECTION_TARGETS] = XInternAtom(Xdisplay, "TARGETS", False); props[PROP_ENL_COMMS] = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True); + props[PROP_ENL_VERSION] = XInternAtom(Xdisplay, "ENLIGHTENMENT_VERSION", True); props[PROP_ENL_MSG] = XInternAtom(Xdisplay, "ENL_MSG", False); props[PROP_DELETE_WINDOW] = XInternAtom(Xdisplay, "WM_DELETE_WINDOW", False); props[PROP_DND_PROTOCOL] = XInternAtom(Xdisplay, "DndProtocol", False); diff --git a/src/startup.h b/src/startup.h index 9358ae8..0fa14d9 100644 --- a/src/startup.h +++ b/src/startup.h @@ -98,6 +98,7 @@ enum { PROP_SELECTION_INCR, PROP_SELECTION_TARGETS, PROP_ENL_COMMS, + PROP_ENL_VERSION, PROP_ENL_MSG, PROP_DELETE_WINDOW, PROP_DND_PROTOCOL, -- cgit v1.2.1