diff --git a/core/src/main/java/com/github/weisj/darklaf/LafManager.java b/core/src/main/java/com/github/weisj/darklaf/LafManager.java index 9efb655a..521cb46f 100644 --- a/core/src/main/java/com/github/weisj/darklaf/LafManager.java +++ b/core/src/main/java/com/github/weisj/darklaf/LafManager.java @@ -192,9 +192,10 @@ public final class LafManager { updateLafRecursively(childWindow); } SwingUtilities.updateComponentTreeUI(window); - // Use custom decorations when supported by the LAF + //Ensure decorations are applied appropriately. + boolean wasVisible = window.isVisible(); window.dispose(); - window.setVisible(true); + window.setVisible(wasVisible); } /** diff --git a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java index ed680a37..a2198909 100644 --- a/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java +++ b/windows/src/main/java/com/github/weisj/darklaf/platform/windows/ui/WindowsTitlePane.java @@ -637,10 +637,12 @@ public class WindowsTitlePane extends CustomTitlePane { } private boolean hideTitleBar() { + String title = titleLabel.getText(); + if (title == null) title = ""; return windowHandle == 0 || (getWindowDecorationStyle() == JRootPane.NONE && menuBar == null - && titleLabel.getText().length() == 0); + && title.length() == 0); } private class TitlePaneLayout implements LayoutManager {