示例#1
0
        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();
        }
示例#2
0
 public static extern int XSetIOErrorHandler(X11IOErrorDelegate handler);