[Gambas-user] an observation on window placement with multiple screens

Bruce Steers bsteers4 at gmail.com
Thu Oct 13 17:44:03 CEST 2022

On Thu, 13 Oct 2022 at 13:43, Benoit Minisini <
benoit.minisini at gambas-basic.org> wrote:

> Le 13/10/2022 à 14:03, Bruce Steers a écrit :
> > I want to handle it first hand, not after via save/restore a setting
> > if i use Settings.Write(MyForm)
> > It saves the window geometry and the screen number so i could read the
> > Form.Settings property but Benoit has stated this syntax may change so
> > it's not wise to use it.
> > I've looked at the Screen class and there is no ID or Number property to
> > get data about the current screen.
> >
> > Can the Screens[] array Index be a reliable Id, so Screens[1] is 1 as
> > the Form.Settings would save it?
> >
> > Can i tell what screen my open application is on?
> > Then force other windows like Dialogs and Messages and widows that have
> > not had their position saved to be on the chosen screen?
> >
> > If not then i think gambas could really do with this feature.
> > It was not my experience that all other applications behaved this way.
> > only some.
> >
> > Respects
> > BruceS
> >
> The problem are the following:
> - You can't directly specifiy the screen a window is. You can only
> specify its position, and the screen is deduced from that position (all
> screens making one sole big logical screen).
> - The window manager decides where a window appears. On X11, you can
> suggest a position.
> - On Wayland, you can't specify a window position!
> So it's almost impossible to have a window opening intelligently
> automatically in all cases. I will think a bit and see what I can do,
> but I'm afraid that on Wayland we can't do anything.
> Regards,
> --
> Benoît Minisini.

I thought the "one big screen" was only relevant to virtual desktops not
physical displays/monitors?
Virtual desktop positions is also pretty uncontrollable as you can get
window positions but they are relevant to the active window.
So for an application that has a window on desktop 1 and 2 from desktop 1
window positions for both windows are window 1 as normal and window 2 is
it's position + screen width but if on desktop 2 window 2 is normal and
window 1 is position - screen width.
That's a bit confusing but can be dealt with.

The problem though is you cannot re-open a window on another desktop as you
cannot set a screen position greater than a single screen width or less
than 0 so windows only ever open on the active desktop

So the problem here is not to do with virtual desktop screens as they in
fact do open windows on the relevant desktop.
it's actual physical displays

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221013/b2ef2093/attachment-0001.htm>

More information about the User mailing list