void startGrab(Window grabWindow, Runnable whenCanceled) {
if (nativeGrabOwner != null) {
throw new RuntimeException("Attempt to start nested mouse grab");
}
NativeWindow win = grabWindow.getNativeWindow();
if (win == null) {
throw new RuntimeException(
"Attempt to grab mouse in not displayable window");
}
nativeGrabOwner = grabWindow;
this.whenCanceled = whenCanceled;
win.grabMouse();
}