Event event = new Event ();
public boolean open () {	checkWidget();	int xDisplay = display.xDisplay;	int color = OS.XWhitePixel (xDisplay, 0);	int xWindow = OS.XDefaultRootWindow (xDisplay);	if (parent != null) {		xWindow = OS.XtWindow (parent.handle);		if (xWindow == 0) return false;	}	boolean cancelled = false;	tracking = true;	drawRectangles ();	Event event = new Event ();	XAnyEvent xEvent = new XAnyEvent ();	int [] unused = new int [1];	int [] newX = new int [1], newY = new int [1], oldX = new int [1], oldY = new int [1];	int xtContext = OS.XtDisplayToApplicationContext (xDisplay);	OS.XQueryPointer (xDisplay, xWindow, unused, unused, oldX, oldY, unused, unused, unused);	while (tracking) {		if (parent != null && parent.isDisposed ()) break;		OS.XtAppNextEvent (xtContext,  xEvent);		switch (xEvent.type) {			case OS.ButtonRelease:			case OS.MotionNotify:				OS.XQueryPointer (xDisplay, xWindow, unused, unused, newX, newY, unused, unused, unused);				if (oldX [0] != newX [0] || oldY [0] != newY [0]) {					drawRectangles ();					for (int i=0; i<rectangles.length; i++) {						rectangles [i].x += newX [0] - oldX [0];						rectangles [i].y += newY [0] - oldY [0];					}					sendEvent (SWT.Move);					drawRectangles ();					oldX [0] = newX [0];  oldY [0] = newY [0];				}				tracking = xEvent.type != OS.ButtonRelease;				break;			case OS.KeyPress:				XKeyEvent keyEvent = new XKeyEvent ();				OS.memmove (keyEvent, xEvent, XKeyEvent.sizeof);				if (keyEvent.keycode != 0) {					int [] keysym = new int [1];					OS.XLookupString (keyEvent, null, 0, keysym, unused);					keysym [0] &= 0xFFFF;					tracking = keysym [0] != OS.XK_Escape && keysym [0] != OS.XK_Cancel;					cancelled = !tracking;				}				break;		}	}	drawRectangles ();	tracking = false;	return !cancelled;}