static int screenNrOfWindow(Window w) { if (w == null) ret -1; Rect bounds = boundsAsRect(w); ret indexOfMax(allScreenBounds(), screen -> area(intersectRects(bounds, screen))); }