public SharedXConnection()
        {
            //Using a standard loop of XNextEvent was causing unpredictable issues,
            //instead we poll the X server for events every few MS. (TODO - poll properly)
            XInitThreads();
            XDisplay = XOpenDisplay(0);

            if (XDisplay == IntPtr.Zero)
            {
                throw new XLibException("Failed to connect to X");
            }

            XRootWindow = XDefaultRootWindow(XDisplay);

            errorHandler   = HandleError;
            ioErrorHandler = HandleIOError;

            XSetErrorHandler(errorHandler);
            XSetIOErrorHandler(ioErrorHandler);
            new Task(() => EventLoop()).Start();
        }
Beispiel #2
0
 public static extern int XSetErrorHandler(X11ErrorDelegate handler);