spawn_window.c
static int hasCorrectXdndAwareProperty(Display *disp, Window wind) {
	// Try to get property
	int retVal = 0;
	Atom actualType = None;
	int actualFormat;
	unsigned long numOfItems, bytesAfterReturn;
	unsigned char *data = NULL;
	if (XGetWindowProperty(disp, wind, XdndAware, 0, 1024, False, AnyPropertyType,
		&actualType, &actualFormat, &numOfItems, &bytesAfterReturn, &data) == Success) {
		if (actualType != None) {
			// Assume architecture is little endian and just read first byte for
			// XDND protocol version
			if (data[0] <= XDND_PROTOCOL_VERSION) {
				retVal = data[0];
			}

			XFree(data);
		}
	}

	return retVal;
}
// This checks if the supplied window has the XdndAware property
This checks if the supplied window has the XdndAware property
This checks if the supplied window has the XdndAware property
static int hasCorrectXdndAwareProperty(Display *disp, Window wind) {
	int retVal = 0;
	Atom actualType = None;
	int actualFormat;
	unsigned long numOfItems, bytesAfterReturn;
	unsigned char *data = NULL;
	if (XGetWindowProperty(disp, wind, XdndAware, 0, 1024, False, AnyPropertyType,
		&actualType, &actualFormat, &numOfItems, &bytesAfterReturn, &data) == Success) {
		if (actualType != None) {
			if (data[0] <= XDND_PROTOCOL_VERSION) {
				retVal = data[0];
			}
			XFree(data);
		}
	}
	return retVal;
}
static int hasCorrectXdndAwareProperty ( Display * disp , Window wind ) { int retVal = 0 ; Atom actualType = None ; int actualFormat ; unsigned long numOfItems , bytesAfterReturn ; unsigned char * data = NULL ; if ( XGetWindowProperty ( disp , wind , XdndAware , 0 , 1024 , False , AnyPropertyType , & actualType , & actualFormat , & numOfItems , & bytesAfterReturn , & data ) == Success ) { if ( actualType != None ) { if ( data [ 0 ] <= XDND_PROTOCOL_VERSION ) { retVal = data [ 0 ] ; } XFree ( data ) ; } } return retVal ; }
This checks if the supplied window has the XdndAware property
This checks if the supplied window has the XdndAware property
// Try to get property // Assume architecture is little endian and just read first byte for // XDND protocol version