On 19.08.2011 13:58, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>
>>> maybe someone else can remember why we did it this way...
>>
>> Oh buy, this code is over 10 years old. I can barely remember
>> what I had for lunch yesterday ;-)
>>
>> If a window is fully off screen, we should probably loop
>> through all available screens and find the one that is
>> closest to the desired position. I am afraid that that is not
>> such a simple task though... . I remember we did something
>> somewhat intelligent when placing menus. Maybe we can reuse that code?
>
> I think the screen_xywh() function has something like that, if you pass
> it a rectangle it will tell you which screen the rectangle is most on,
> if it straddles more than one screen. Or at least, I think that's what
> it's trying to do, anyway!
Yup, that ought to do it, instead of trying to match only the window's
origin / top left corner. If it works as expected, at least. ;-)
static void screen_xywh (int &X, int &Y, int &W, int &H,
int mx, int my, int mw, int mh)
Gets the screen bounding rect for the screen which intersects the most
with the rectangle defined by mx, my, mw, mh.
<http://www.fltk.org/doc-1.3/group__fl__screen.html#gabe29a526a41ffb5df1c5116cf61ead54>
The second step (adjusting the window to be entirely within the
screen) would then be the same.
Tried it - that was soooo easy! :-)
I'll commit it right after posting this message...
Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev