newX = Math.min (Math.max (0, (int)px [0] + x - startX - parentBorder), parentWidth - width);
newX = Math.min (Math.max (0, eventX + x - startX - parentBorder), parentWidth - width);
int gtk_motion_notify_event (int widget, int eventPtr) {	int result = super.gtk_motion_notify_event (widget, eventPtr);	int [] state = new int [1];	OS.gdk_event_get_state (eventPtr, state);	if (!dragging || (state [0] & OS.GDK_BUTTON1_MASK) == 0) return 0;	int x = OS.GTK_WIDGET_X (handle);	int y = OS.GTK_WIDGET_Y (handle);	int width = OS.GTK_WIDGET_WIDTH (handle);	int height = OS.GTK_WIDGET_HEIGHT (handle);	int parentBorder = 0;	int parentWidth = OS.GTK_WIDGET_WIDTH (parent.handle);	int parentHeight = OS.GTK_WIDGET_HEIGHT (parent.handle);	double[] px = new double [1], py = new double [1];	OS.gdk_event_get_coords (eventPtr, px, py);	int newX = lastX, newY = lastY;	if ((style & SWT.VERTICAL) != 0) {		newX = Math.min (Math.max (0, (int)px [0] + x - startX - parentBorder), parentWidth - width);	} else {		newY = Math.min (Math.max (0, (int)py[0] + y - startY - parentBorder), parentHeight - height);	}	if (newX == lastX && newY == lastY) return 0;	drawBand (lastX, lastY, width, height);	/* The event must be sent because its doit flag is used. */	Event event = new Event ();	event.detail = SWT.DRAG;	event.time = OS.gdk_event_get_time (eventPtr);	event.x = newX;  event.y = newY;	event.width = width;  event.height = height;	/*	 * It is possible (but unlikely) that client code could have disposed	 * the widget in the selection event.  If this happens end the processing	 * of this message by returning.	 */	sendEvent (SWT.Selection, event);	if (isDisposed ()) return 0;	if (event.doit) {		lastX = event.x;  lastY = event.y;		drawBand (lastX, lastY, width, height);	}	return result;}