https://invisible-island.net/xterm/xtoolkit/
XtDisplayToApplicationContext - obtain an application context
#include <X11/Intrinsic.h> XtAppContext XtDisplayToApplicationContext(Display* dpy);
dpy Specifies the display that you want the application context for.
The XtDisplayToApplicationContext function returns the application con- text for the specified display.
X Toolkit Intrinsics – C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.5.2XtDisplayToApplicationContext(3)