runelite-client: Don't try to contain to screen when contain is off
Java's GraphicsConfiguration::getBounds() is completely nonfunctional for me, returning nearly random values, which causes the our window to move itself to random places, often outside of my displays' bounds
This commit is contained in:
@@ -113,9 +113,12 @@ public class ContainableFrame extends JFrame
|
|||||||
if (forcedWidthIncrease || expandResizeType == ExpandResizeType.KEEP_GAME_SIZE)
|
if (forcedWidthIncrease || expandResizeType == ExpandResizeType.KEEP_GAME_SIZE)
|
||||||
{
|
{
|
||||||
final int newWindowWidth = getWidth() + increment;
|
final int newWindowWidth = getWidth() + increment;
|
||||||
|
int newWindowX = getX();
|
||||||
|
|
||||||
|
if (containedInScreen)
|
||||||
|
{
|
||||||
final Rectangle screenBounds = getGraphicsConfiguration().getBounds();
|
final Rectangle screenBounds = getGraphicsConfiguration().getBounds();
|
||||||
final boolean wouldExpandThroughEdge = getX() + newWindowWidth > screenBounds.getX() + screenBounds.getWidth();
|
final boolean wouldExpandThroughEdge = getX() + newWindowWidth > screenBounds.getX() + screenBounds.getWidth();
|
||||||
int newWindowX = getX();
|
|
||||||
|
|
||||||
if (wouldExpandThroughEdge)
|
if (wouldExpandThroughEdge)
|
||||||
{
|
{
|
||||||
@@ -131,6 +134,7 @@ public class ContainableFrame extends JFrame
|
|||||||
|
|
||||||
expandedClientOppositeDirection = true;
|
expandedClientOppositeDirection = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setBounds(newWindowX, getY(), newWindowWidth, getHeight());
|
setBounds(newWindowX, getY(), newWindowWidth, getHeight());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user