After the DropEvent is fired, your Button is in position and about to become member of the HStack. Nothing can actually stop this. So when you receive this event all you have to do at the HStack is to retrieve the source of the event and call its getAbsoluteLeft and getAbsoluteTop methods. This will give you the position of the Button within the browser. If you want to receive the position within the HSTack, add them to the Left and Top coordinates of the HStack, respectively. Something like the following can be used:
HStack hStack = new HStack();
hStack.addDropHandler(new DropHandler() {
@Override
public void onDrop(DropEvent event) {
Object source = event.getSource();
if (source instanceof BaseWidget) { //This shall cover all Buttons and UI elements.
int buttonLeftPosition = ((BaseWidget) source).getAbsoluteLeft();
int buttonTopPosition = ((BaseWidget) source).getAbsoluteTop();
}
}
});