if ((style & DND.DROP_DEFAULT) != 0) { int xDisplay = getDisplay().xDisplay; int xWindow = OS.XDefaultRootWindow (xDisplay); int [] unused = new int [1]; int[] mask_return = new int[1]; OS.XQueryPointer (xDisplay, xWindow, unused, unused, unused, unused, unused, unused, mask_return); int mask = mask_return[0]; if ((mask & OS.ShiftMask) == 0 && (mask & OS.ControlMask) == 0) { operation = DND.DROP_DEFAULT; }
int xDisplay = getDisplay().xDisplay; int xWindow = OS.XDefaultRootWindow (xDisplay); int [] unused = new int [1]; int[] mask_return = new int[1]; OS.XQueryPointer (xDisplay, xWindow, unused, unused, unused, unused, unused, unused, mask_return); int mask = mask_return[0]; if ((mask & OS.ShiftMask) == 0 && (mask & OS.ControlMask) == 0) { operation = (style & DND.DROP_DEFAULT) != 0 ? DND.DROP_DEFAULT : DND.DROP_NONE;
private boolean setEventData(byte ops, byte op, int dragContext, short x, short y, int timestamp, DNDEvent event) {	//get allowed operations	int style = getStyle();	int operations = osOpToOp(ops) & style;	if (operations == DND.DROP_NONE) return false;		//get current operation	int operation = osOpToOp(op);	if ((operation & operations) == 0) operation = DND.DROP_NONE;	if ((style & DND.DROP_DEFAULT) != 0) {		int xDisplay = getDisplay().xDisplay;		int xWindow = OS.XDefaultRootWindow (xDisplay);		int [] unused = new int [1];		int[] mask_return = new int[1];		OS.XQueryPointer (xDisplay, xWindow, unused, unused, unused, unused, unused, unused, mask_return);		int mask = mask_return[0];		if ((mask & OS.ShiftMask) == 0 && (mask & OS.ControlMask) == 0) {			operation = DND.DROP_DEFAULT;		}	}		//Get allowed transfer types	int ppExportTargets = OS.XtMalloc(4);	int pNumExportTargets = OS.XtMalloc(4);	int[] args = new int[]{		OS.XmNexportTargets,          ppExportTargets,		OS.XmNnumExportTargets,       pNumExportTargets	};	OS.XtGetValues(dragContext, args, args.length / 2);	int[] numExportTargets = new int[1];	OS.memmove(numExportTargets, pNumExportTargets, 4);	OS.XtFree(pNumExportTargets);	int[] pExportTargets = new int[1];	OS.memmove(pExportTargets, ppExportTargets, 4);	OS.XtFree(ppExportTargets);	int[] exportTargets = new int[numExportTargets[0]];	OS.memmove(exportTargets, pExportTargets[0], 4*numExportTargets[0]);	//?OS.XtFree(pExportTargets[0]);	TransferData[] dataTypes = new TransferData[0];	for (int i = 0; i < exportTargets.length; i++){		for (int j = 0; j < transferAgents.length; j++){			TransferData transferData = new TransferData();			transferData.type = exportTargets[i];			if (transferAgents[j].isSupportedType(transferData)) {				TransferData[] newDataTypes = new TransferData[dataTypes.length + 1];				System.arraycopy(dataTypes, 0, newDataTypes, 0, dataTypes.length);				newDataTypes[dataTypes.length] = transferData;				dataTypes = newDataTypes;				break;			}		}	}	if (dataTypes.length == 0) return false;	short [] root_x = new short [1];	short [] root_y = new short [1];		OS.XtTranslateCoords (this.control.handle, (short) x, (short) y, root_x, root_y);		event.widget = this;	event.x = root_x[0];	event.y = root_y[0];	event.time = timestamp;	event.feedback = DND.FEEDBACK_SELECT;	event.dataTypes = dataTypes;	event.dataType = dataTypes[0];	event.operations = operations;	event.detail = operation;		return true;}