diff options
Diffstat (limited to 'src/e.c')
-rw-r--r-- | src/e.c | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -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; } @@ -85,6 +84,30 @@ enl_ipc_get_win(void) 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)) { D_ENL((" -> IPC Window property is valid, but the window doesn't exist. I give up!\n")); |