* Also, attempts to set a border on either the shell handle
* Attempts to set a border on either the shell handle
void createHandle (int index) {	state |= HANDLE | CANVAS;	int decorations = 0;	if ((style & SWT.NO_TRIM) == 0) {		if ((style & SWT.MIN) != 0) decorations |= OS.MWM_DECOR_MINIMIZE;		if ((style & SWT.MAX) != 0) decorations |= OS.MWM_DECOR_MAXIMIZE;		if ((style & SWT.RESIZE) != 0) decorations |= OS.MWM_DECOR_RESIZEH;		if ((style & SWT.BORDER) != 0) decorations |= OS.MWM_DECOR_BORDER;		if ((style & SWT.MENU) != 0) decorations |= OS.MWM_DECOR_MENU;		if ((style & SWT.TITLE) != 0) decorations |= OS.MWM_DECOR_TITLE;		/*		* Feature in Motif.  Under some Window Managers (Sawmill), in order		* to get any border at all from the window manager it is necessary		* to set MWM_DECOR_BORDER.  The fix is to force these bits when any		* kind of border is requested.		*/		if ((style & SWT.RESIZE) != 0) decorations |= OS.MWM_DECOR_BORDER;	}		/*	* Note: Motif treats the modal values as hints to the Window Manager.	* For example, Enlightenment treats all modes except for SWT.MODELESS	* as SWT.APPLICATION_MODAL.  The Motif Window Manager honours all modes.	*/	int inputMode = OS.MWM_INPUT_MODELESS;	if ((style & SWT.PRIMARY_MODAL) != 0) inputMode = OS.MWM_INPUT_PRIMARY_APPLICATION_MODAL;	if ((style & SWT.APPLICATION_MODAL) != 0) inputMode = OS.MWM_INPUT_FULL_APPLICATION_MODAL;	if ((style & SWT.SYSTEM_MODAL) != 0) inputMode = OS.MWM_INPUT_SYSTEM_MODAL;		/* 	* Bug in Motif.  For some reason, if the title string	* length is not a multiple of 4, Motif occasionally	* draws garbage after the last character in the title.	* The fix is to pad the title.	*/	byte [] buffer = {(byte)' ', 0, 0, 0};	int ptr = OS.XtMalloc (buffer.length);	OS.memmove (ptr, buffer, buffer.length);	int [] argList1 = {		OS.XmNmwmInputMode, inputMode,		OS.XmNmwmDecorations, decorations,		OS.XmNoverrideRedirect, (style & SWT.ON_TOP) != 0 ? 1 : 0,		OS.XmNtitle, ptr,	};	if ((style & SWT.ON_TOP) != 0) reparented = true;	byte [] appClass = display.appClass;	if (parent == null && (style & SWT.ON_TOP) == 0) {		int xDisplay = display.xDisplay;		int widgetClass = OS.TopLevelShellWidgetClass ();		shellHandle = OS.XtAppCreateShell (display.appName, appClass, widgetClass, xDisplay, argList1, argList1.length / 2);	} else {		int widgetClass = OS.TransientShellWidgetClass ();//		if ((style & SWT.ON_TOP) != 0) {//			widgetClass = OS.OverrideShellWidgetClass ();//		}		int parentHandle = display.shellHandle;		if (parent != null) parentHandle = parent.handle;		shellHandle = OS.XtCreatePopupShell (appClass, widgetClass, parentHandle, argList1, argList1.length / 2);	}	OS.XtFree (ptr);	if (shellHandle == 0) error (SWT.ERROR_NO_HANDLES);	/* Create scrolled handle */	createScrolledHandle (shellHandle);	/*	* Feature in Motif.  There is no way to get the single pixel	* border surrounding a TopLevelShell or a TransientShell.	* Also, attempts to set a border on either the shell handle	* or the main window handle fail.  The fix is to set the border	* on the client area.	*/	if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.RESIZE)) == 0) {		int [] argList2 = {OS.XmNborderWidth, 1};		OS.XtSetValues (handle, argList2, argList2.length / 2);	}		/*	* Feature in Motif. There is no Motif API to negociate for the	* status line. The fix is to force the status line to appear	* by creating a hidden text widget.  This is much safer than	* using X API because this may conflict with Motif.	*	* Note that  XmNtraversalOn must be set to FALSE or the shell	* will not take focus when the user clicks on it.	*/	if ((style & SWT.ON_TOP) == 0) {		int [] argList3 = {OS.XmNtraversalOn, 0};		int textHandle = OS.XmCreateTextField (handle, null, argList3, argList3.length / 2);		if (textHandle == 0) error (SWT.ERROR_NO_HANDLES);	}}