internal override void SetWindowTransparency(IntPtr handle, double transparency, Color key) {
Hwnd hwnd;
IntPtr opacity;
hwnd = Hwnd.ObjectFromHandle(handle);
if (hwnd == null) {
return;
}
hwnd.opacity = (uint)(0xffffffff * transparency);
opacity = (IntPtr)((int)hwnd.opacity);
IntPtr w = hwnd.whole_window;
if (hwnd.reparented)
w = XGetParent (hwnd.whole_window);
XChangeProperty(DisplayHandle, w, _NET_WM_WINDOW_OPACITY, (IntPtr)Atom.XA_CARDINAL, 32, PropertyMode.Replace, ref opacity, 1);
}