+ x11display = NULL;
+ x11window = 0;
+
+ x11lib = dlopen("libX11.so.6", RTLD_LAZY);
+ if (x11lib != NULL) {
+ pXGetGeometry = dlsym(x11lib, "XGetGeometry");
+ pXGetWindowAttributes = dlsym(x11lib, "XGetWindowAttributes");
+ pXTranslateCoordinates = dlsym(x11lib, "XTranslateCoordinates");
+ if (pXGetGeometry != NULL && pXGetWindowAttributes != NULL
+ && pXTranslateCoordinates != NULL)
+ {
+ x11display = *display;
+ x11window = (Window)*window;
+ }
+ }