private static void uninstall( Window window ) {
		if( !hasCustomDecoration( window ) )
			return;

		// disable native window border for window
		setHasCustomDecoration( window, false );

		if( window instanceof JFrame ) {
			JFrame frame = (JFrame) window;

			// disable Swing window decoration
			frame.getRootPane().setWindowDecorationStyle( JRootPane.NONE );

		} else if( window instanceof JDialog ) {
			JDialog dialog = (JDialog) window;

			// disable Swing window decoration
			dialog.getRootPane().setWindowDecorationStyle( JRootPane.NONE );
		}
	}
Support for custom window decorations with native window border.

@author Karl Tauber
@since 1.1
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java