A double click in a result set opens the window "Value of column ...".
However, if you double click near by the bottom edge or right edge of the screen,
the window sometimes is positioned to a "strange" location.
Lets say the screen resolution is 1600 x 900.
a)
If you double click near by e.g. x600/y800, the bottom window edge perfectly docks to the bottom screen edge.
Unfortunately, the horizontal position is far too much left.
b)
If you double click near by e.g. x1500/y400, the right window edge perfectly docks to the right screen edge.
Unfortunately, the vertical position is far too much north.
I think I was able to track down the reason to method "ensureBoundsOnOneScreen(Rectangle rectInScreenCoordinates)" in class "net.sourceforge.squirrel_sql.fw.gui.GUIUtils".
A modification like this worked for me:
// int dx = Math.abs(screenBounds.x + screenBounds.width - (rectInScreenCoordinates.x + rectInScreenCoordinates.width));
// int dy = Math.abs(screenBounds.y + screenBounds.height - (rectInScreenCoordinates.y + rectInScreenCoordinates.height));
int dx = screenBounds.x + screenBounds.width - (rectInScreenCoordinates.x + rectInScreenCoordinates.width);
int dy = screenBounds.y + screenBounds.height - (rectInScreenCoordinates.y + rectInScreenCoordinates.height);
And:
// rectInScreenCoordinates.x = Math.max(0, rectInScreenCoordinates.x - minDx);
// rectInScreenCoordinates.y = Math.max(0, rectInScreenCoordinates.y - minDy);
if (minDx < 0)
{
rectInScreenCoordinates.x = Math.max(0, rectInScreenCoordinates.x + minDx);
}
if (minDy < 0)
{
rectInScreenCoordinates.y = Math.max(0, rectInScreenCoordinates.y + minDy);
}
However, I have no possibility to test it with a second screen.
So I think it would be a good idea to check my suggestion from that point of view as well.
When I move SQuirreL SQL to my second monitor (positioned to the left of the first), double clicking on a lower row cell opens the "Value of column ..." window on my first monitor, although there's plenty of horizontal space available on the second monitor.
Chris, I committed your changes. They made positioning work better for me, too. Thank you.
Stanimir, with Chris's changes I couldn't reproduce your problem anymore and I at least remember having seen that kind of behavior. Could you try it out again with Chris's changes? Thanks.
The "Value of column" window now shows on the same monitor if there's enough horizontal space for it. Clicking on a far right cell of the result shows the window on the left monitor, as expected I guess.