private void doShowPopup(PopupSource popupSource) {

		hideAllWindows();

		sourceComponent = popupSource.getSource();
		sourceComponent.addMouseListener(sourceMouseListener);
		sourceComponent.addMouseMotionListener(sourceMouseMotionListener);

		Dimension popupSize = popup.getSize();
		ensureSize(popupSize);

		//
		// Creates a rectangle that contains both given rectangles entirely and includes padding.
		// The padding allows users to mouse over the edge of the hovered area without triggering 
		// the popup to close.
		//
		Rectangle visibleArea = popupSource.getScreenKeepVisibleArea();
		Rectangle screenBounds = WindowUtilities.getVisibleScreenBounds().getBounds();
		Rectangle placement = popupWindowPlacer.getPlacement(popupSize, visibleArea, screenBounds);
		mouseMovementArea = placement.union(visibleArea);

		popup.setBounds(placement);
		popup.setVisible(true);

		removeOldPopupReferences();

		VISIBLE_POPUPS.add(new WeakReference<>(this));
	}
Shows the popup window.  This will hide any existing popup windows, adjusts the new popup
to avoid covering the keep visible area and then shows the popup.

@param popupSource the popup source that contains info about the source of the popup, such
as the component, a mouse event and any area to keep visible.
Ghidra/Framework/Docking/src/main/java/docking/widgets/PopupWindow.java