private void adjustBounds() {

		if (bounds.height == 0 || bounds.width == 0) {
			window.pack();
			Dimension d = window.getSize();
			bounds.height = d.height;
			bounds.width = d.width;
		}

		Window activeWindow = winMgr.getActiveWindow();
		Point p = bounds.getLocation();
		if (p.x == 0 && p.y == 0) {
			p = WindowUtilities.centerOnScreen(activeWindow, bounds.getSize());
			bounds.setLocation(p);
		}

		WindowUtilities.ensureOnScreen(activeWindow, bounds);
	}
Ensures the bounds of this window have a valid location and size
Ghidra/Framework/Docking/src/main/java/docking/DetachedWindowNode.java