Exemplo n.º 1
0
	extern public static void XSetWMHints
			(IntPtr display, XWindow w, ref XWMHints hints);
	// Set the XWMHints structure on this window.
	private void SetWMHints(IntPtr display, XWindow handle)
			{
				XWMHints hints = new XWMHints();
				hints.flags = WMHintsMask.InputHint |
							  WMHintsMask.StateHint |
							  WMHintsMask.WindowGroupHint;
				hints.input = true;
				hints.initial_state = (iconic ? WindowState.IconicState
											  : WindowState.NormalState);
				hints.window_group = (XID)(dpy.groupLeader);
				if(icon != null)
				{
					Pixmap pixmap = icon.Pixmap;
					Bitmap mask = icon.Mask;
					if(mask != null)
					{
						hints.flags |= WMHintsMask.IconPixmapHint |
									   WMHintsMask.IconMaskHint;
						hints.icon_pixmap = pixmap.GetPixmapHandle();
						hints.icon_mask = mask.GetPixmapHandle();
					}
					else
					{
						hints.flags |= WMHintsMask.IconPixmapHint;
						hints.icon_pixmap = pixmap.GetPixmapHandle();
					}
				}
				Xlib.XSetWMHints(display, handle, ref hints);
			}