static API()
{
int has_threaded_x = Functions.XInitThreads();
Debug.Print("Initializing threaded X11: {0}.", has_threaded_x.ToString());
defaultDisplay = Functions.XOpenDisplay(IntPtr.Zero);
if (defaultDisplay == IntPtr.Zero)
throw new PlatformException("Could not establish connection to the X-Server.");
using (new XLock(defaultDisplay))
{
screenCount = Functions.XScreenCount(DefaultDisplay);
}
Debug.Print("Display connection: {0}, Screen count: {1}", DefaultDisplay, ScreenCount);
//AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
}