If your screen is opened as Dialog, you can use DialogWindow API:
@UiController("demo_NewScreen")
@UiDescriptor("new-screen.xml")
public class NewScreen extends Screen {
@Subscribe("demoBtn")
protected void onDemoBtnClick(Button.ClickEvent event) {
// use instanceof to check mode if needed
DialogWindow window = (DialogWindow) getWindow();
int positionX = window.getPositionX();
int positionY = window.getPositionY();
// set new position to window
window.setPosition(positionX + 10, positionY + 10);
}
}
Please note that screen must be shown in a web browser before you read actual position X and Y values. However you can set them during opening of a screen.