private void XSetWMProtocols(LinuxX11WindowImpl window) { GCHandle valueHandle = default; try { var atom = (ulong)WM_DELETE_PROTOCOL; valueHandle = GCHandle.Alloc(atom, GCHandleType.Pinned); int res = Xlib.XChangeProperty(Display, window.XWindow, property: WM_PROTOCOL, type: X11.Atom.Atom, format: 32, //bits, (int)X11.PropertyMode.Replace, data: valueHandle.AddrOfPinnedObject(), nelements: 1 /*count*/); } finally { if (valueHandle.IsAllocated) { valueHandle.Free(); } } }
public IWindowImpl CreateWindow(int width, int height) { var wind = new LinuxX11WindowImpl(this, width == 0 ? 1 : width, height == 0 ? 1 : height); Services.Logger.LogWindowingSystemEvent("Window {0} created.", wind.XWindow); _windows.Add(wind); XSetWMProtocols(wind); WindowCreated?.Invoke(new WindowEventArgs(wind)); return(wind); }