Window positions under wayland

Igor Korot ikorot01 at gmail.com
Thu Aug 4 19:46:40 UTC 2022


Hi, Carsten,

On Thu, Aug 4, 2022 at 2:31 PM Carsten Haitzler <raster at rasterman.com> wrote:
>
> On Thu, 4 Aug 2022 13:32:36 -0500 Igor Korot <ikorot01 at gmail.com> said:
>
> > Hi,
> >
> > On Thu, Aug 4, 2022 at 12:58 PM samuel ammonius <sfammonius at gmail.com> wrote:
> > >
> > > Dude, I'm trying to persuade the wayland devs to change this, not have an
> > > argument about how much wayland sucks. Thanks for explaining that this was
> > > supposed to be a feature though. I hadn't known that before.
> >
> > You most welcome.
> > And like I said - you are not the only one. Others tried and failed.
> >
> > They think its a feature and will tell you "Its by design".
>
> It is by design. And it's right. From decades of apps being able to position in
> X11 and expecting to be able to and then screwing it up again and again and
> again... Wayland got it right.

I'm not sure what you mean.
Can you give an example of "screwing again and again and again...", please?

If my code expects the window to be placed at 1 monitor position (100, 100) -
what is wrong with that?

All I can do as a developer is to write:

[pseudo-code]
MyApp:MyApp()
{
     myTLW = new Frame( NULL, ID, "My Beautiful Window", position(
100, 100 ), defaultsize, tlwstyles );
     mytklw-> Show( true );
}
[/pseudo-code]

What is wrong with that?

Thank you.

>
> If you allow positioning then apps RELY on it. They act is totally broken ways
> when the compositor refuses to allow that. The right thing to do is to remove
> their expectation of such control.
>
> Apps can use subsurfaces which can position RELATIVE to a parent (e.g. used for
> menu popups etc. but could be used for dialogs). You could also just draw a
> dialog inline inside your main window and do whatever you want inside of that.
> This is up to your app (and whatever toolkit it may use if it uses one).
>
> It is the apps' job to indicate a dialog is a dialog for a parent surface. if
> they do then the compositor SHOULD place that dialog relative to that surface
> sensibly (e.g. centered). If it doesn't do something sensible OR do what the
> user has explicitly configured it to do because the user wants something
> broken (and the compositor allows it), then that compositor needs
> improving/fixing. It's easier to fix a few compositors than it is to fix the
> endless chain of 100's of broken applications.
>
> > Thank you.
> >
> > >
> > > On Thu, Aug 4, 2022 at 3:14 PM Igor Korot <ikorot01 at gmail.com> wrote:
> > >>
> > >> Hi,
> > >>
> > >> On Thu, Aug 4, 2022 at 12:37 PM samuel ammonius <sfammonius at gmail.com>
> > >> wrote:
> > >> >
> > >> > Compositors can prevent apps from doing this if they want to, but there
> > >> > needs to be some built-in way for windows to set their positions. Not
> > >> > having this isn't a feature.
> > >>
> > >> I am not a Wayland developer.
> > >>
> > >> But based on the multiple replies here and there - it is the main
> > >> feature of the Wayland.
> > >> It will never allow the application to set its position/size.
> > >> It will however allow the end-user (a human) to configure Wayland
> > >> (compositor) in any waythey want
> > >> and however stupid they want.
> > >>
> > >> And Wayland developers consider it to be "BIG WAYLAND FEATURE".
> > >>
> > >> So forget about cross-platform applications behaving the same, forget
> > >> about even writing sane application on Linux.
> > >> Wayland (compositor) will be set up by the user (a human) in such a
> > >> way so that the application could become
> > >> completely unusable.
> > >>
> > >> Thank you.
> > >>
> > >> >
> > >> > On Thu, Aug 4, 2022 at 2:57 PM Igor Korot <ikorot01 at gmail.com> wrote:
> > >> >>
> > >> >> On Thu, Aug 4, 2022 at 12:06 PM Simon Ser <contact at emersion.fr> wrote:
> > >> >> >
> > >> >> > On Thursday, August 4th, 2022 at 19:00, samuel ammonius
> > >> >> > <sfammonius at gmail.com> wrote:
> > >> >> >
> > >> >> > > apps such as popups and dialogs are usually supposed to start either
> > >> >> > > at the center of the screen or the center of their parent app
> > >> >>
> > >> >> You are barking at the wrong tree.
> > >> >>
> > >> >> Apparently this is the main feature of the Wayland - do not let the
> > >> >> developers set up the position of the TLW.
> > >> >>
> > >> >> >
> > >> >> > That's usually what compositors do: center apps by default. But it's
> > >> >> > to the compositor and user preference.
> > >> >> >
> > >> >> > > apps often want to remember where they were when they closed so they
> > >> >> > > can open there again
> > >> >> >
> > >> >> > This is what [1] addresses.
> > >> >> >
> > >> >> > [1]:
> > >> >> > https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/18
> > >> >>
> > >> >> Finally!! ;-)
> > >> >> Now if only Wayland can respect the calls such as
> > >> >> CenterOnScreen()/CenterOnParent()
> > >> >> for the dialog-like windows it would be great.
> > >> >>
> > >> >> Unfortunately it looks like this will never happen and the application
> > >> >> developers will
> > >> >> have to throw away their software, because apparently dialogs can be
> > >> >> put anywhere
> > >> >> on the screen.
> > >> >>
> > >> >> Something like a dialog asking for credentials to login to the DB that
> > >> >> shows up in the
> > >> >> top left corner, because some idiot user set it this way.
> > >> >>
> > >> >> Thank you.
> >
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> Carsten Haitzler - raster at rasterman.com
>


More information about the wayland-devel mailing list