private void debugPaintComponentWithMouseListener( Graphics g, Color color, Component c, int x, int y ) {
		if( !c.isDisplayable() || !c.isVisible() || c == mouseLayer ||
			c == iconifyButton || c == maximizeButton || c == restoreButton || c == closeButton )
		  return;

		if( c.getMouseListeners().length > 0 ||
			c.getMouseMotionListeners().length > 0 ||
			c.getMouseWheelListeners().length > 0 )
		{
			g.drawRect( x, y, c.getWidth(), c.getHeight() );
			return;
		}

		if( c instanceof Container ) {
			Rectangle titlePaneBoundsOnWindow = SwingUtilities.convertRectangle( this, new Rectangle( getSize() ), window );
			for( Component child : ((Container)c).getComponents() ) {
				Rectangle compBoundsOnWindow = SwingUtilities.convertRectangle( c, new Rectangle( c.getSize() ), window );
				if( compBoundsOnWindow.intersects( titlePaneBoundsOnWindow ) )
					debugPaintComponentWithMouseListener( g, color, child, x + child.getX(), y + child.getY() );
			}
		}
	}
Returns whether the menubar should be embedded into the title pane.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java