public static extern void XNextEvent(IntPtr Display, ref XEvent Event);
public static extern int XLookupString(ref XEvent Key, StringBuilder Buffer, int Count, IntPtr KeySym, IntPtr Useless);
private void FishEvent() { var Event = new XEvent(); Xlib.XNextEvent(Display, ref Event); if(OnEvent != null) OnEvent(Event); if (Event.type == XEventName.CreateNotify) { int Window = Event.CreateWindowEvent.window; Success = true; Windows.Add(Window); SurpressErrors = true; if(Success) RecurseTree(Display, Window); SurpressErrors = false; } else if(Event.type == XEventName.DestroyNotify) { Windows.Remove(Event.DestroyWindowEvent.window); } }