Hi HGM,
I did a bit of testing just now and apparently my 2nd monitor is treated as an extension of the first, so it's in the same X/Y coördinate ballpark. Let's say I have 2 monitor's with 800 pixels width, when I put the winboard board 100pixels inside the 2nd screen, then winboard will save this location as /x=900!
However, the problem occurs when I start winboard with this parameter: winboard decides that this is not an acceptable /x option and uses /x=0 (or some other default) instead. I went ahead and glimpsed at the code:
- Code: Select all
EnsureOnScreen(int *x, int *y)
{
int gap = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION);
/* Be sure window at (x,y) is not off screen (or even mostly off screen) */
if (*x > screenWidth - 32) *x = 0;
if (*y > screenHeight - 32) *y = 0;
if (*x < 10) *x = 10;
if (*y < gap) *y = gap;
}
Here screenWidth is for me the problem: it's set by
- Code: Select all
screenWidth = GetSystemMetrics(SM_CXSCREEN);
elsewhere, but I would like it to be
- Code: Select all
screenWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
(note that I'm not really a windows api C programmer but I found this at
http://msdn.microsoft.com/en-us/library/ms724385(VS.85).aspx where microsoft defines this metric as: "The width of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors. .(snip).")
I wonder if it would be possible for you to try this solution and implement it in your excellent Winboard version:-) I would have tried it myself and maybe made a patch, but I cannot really oversee if there is more impact and it has been about 5 years since I last programmed in C (for my old engine JanWillem).
Thanks in advance, Laurens.
P.s., if you want to send me a version to test (I suppose you cannot fully test it yourself, given your post), I would be happy help.