File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
enigma-swing/src/main/java/org/quiltmc/enigma/gui Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 7979import java .util .stream .Stream ;
8080
8181public class Gui {
82- private static final int DEFAULT_MIN_LEFT_ON_SCREEN = 300 ;
8382 private static final int DEFAULT_MIN_TOP_ON_SCREEN = 200 ;
8483
8584 private final MainWindow mainWindow ;
@@ -238,7 +237,9 @@ private void setupUi() {
238237 final Point windowPos = Config .main ().windowPos .value ().toPoint ();
239238 final Dimension screenSize = Toolkit .getDefaultToolkit ().getScreenSize ();
240239
241- final int clampedX = Utils .clamp (windowPos .x , 0 , screenSize .width - ScaleUtil .scale (DEFAULT_MIN_LEFT_ON_SCREEN ));
240+ // keep the whole width (or as much as will fit) on-screen so window controls in the title bar are accessible
241+ final int clampedX = Utils .clamp (windowPos .x , 0 , Math .max (0 , screenSize .width - frame .getSize ().width ));
242+ // allow some of the bottom to be off-screen, but not the top, because of the title bar
242243 final int clampedY = Utils .clamp (windowPos .y , 0 , screenSize .height - ScaleUtil .scale (DEFAULT_MIN_TOP_ON_SCREEN ));
243244
244245 if (windowPos .x != clampedX || windowPos .y != clampedY ) {
You can’t perform that action at this time.
0 commit comments