Skip to content

Commit 9a52e0b

Browse files
committed
Workaround bug where window becomes tiny
1 parent 937af20 commit 9a52e0b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/scijava/ui/swing/script/TextEditor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,12 @@ public void componentResized(final ComponentEvent e) {
773773

774774
setLocationRelativeTo(null); // center on screen
775775

776+
// HACK: Avoid weird macOS bug where window becomes tiny
777+
// in bottom left corner if centered while maximized.
778+
int y = getLocation().y - 11;
779+
if (y < 0) y = 0;
780+
setLocation(getLocation().x, y);
781+
776782
open(null);
777783

778784
final EditorPane editorPane = getEditorPane();

0 commit comments

Comments
 (0)