Skip to content

Commit e0b3870

Browse files
committed
Fix bug on first run
1 parent b6886a1 commit e0b3870

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/the/bytecode/club/jda/gui/MainViewerGUI.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,11 @@ public void resetWindows()
411411
size = new Dimension(
412412
size.width < 0 ? clientSize.width + size.width : size.width,
413413
size.height < 0 ? clientSize.height + size.height : size.height);
414-
f.setPreferredSize(size);
415-
f.pack();
414+
unmaximizedSize = size;
415+
f.restoreState(VisibleComponent.VISIBLE);
416+
f.restoreSize(size);
416417
Point pos = f.getDefaultPosition();
417-
f.setLocation(pos);
418-
f.setVisible(true);
418+
f.restorePosition(pos);
419419
desktop.getDesktopManager().resizeFrame(f, pos.x, pos.y, size.width, size.height);
420420
}
421421
}

src/main/java/the/bytecode/club/jda/gui/VisibleComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public String getWindowId()
8080
return windowId;
8181
}
8282

83-
private static int
83+
public static int
8484
MAXIMIZED = 1 << 0,
8585
MINIMIZED = 1 << 1,
8686
VISIBLE = 1 << 2;

0 commit comments

Comments
 (0)