Application window geometry specifier

Igor Korot ikorot01 at gmail.com
Tue Jan 12 17:29:50 EST 2021


Hi, Chris,

On Tue, Jan 12, 2021 at 4:05 PM Chris Angelico <rosuav at gmail.com> wrote:
>
> On Wed, Jan 13, 2021 at 7:00 AM Igor Korot <ikorot01 at gmail.com> wrote:
> >
> > Hi, Chris,
> >
> > On Tue, Jan 12, 2021 at 1:33 PM Chris Angelico <rosuav at gmail.com> wrote:
> > >
> > > On Wed, Jan 13, 2021 at 6:18 AM Igor Korot <ikorot01 at gmail.com> wrote:
> > > >
> > > > Hi, Grant,
> > > >
> > > > On Tue, Jan 12, 2021 at 12:47 PM Grant Edwards
> > > > <grant.b.edwards at gmail.com> wrote:
> > > > >
> > > > > On 2021-01-12, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> > > > > > On Tue, 12 Jan 2021, Igor Korot wrote:
> > > > > >
> > > > > >> Keep in mind that if you target Linux, the "modern" window server
> > > > > >> (Wayland) will not allow user code to decide the positioning and size of
> > > > > >> the TLW.
> > > > > >
> > > > > > Igor,
> > > > > >
> > > > > > I suspect that Slackware will continue with X11.
> > > > >
> > > > > And those X11 users will swear at you if you override their window
> > > > > managers configured window placement. Application code should not care
> > > > > about or try to control window geometry. Period.
> > > >
> > > > I have a very strong argument against it!!
> > > >
> > > > Imagine you are developing an application that need to communicate
> > > > with the database.
> > > > Also imagine this application will be used by millions of users inside
> > > > different companies.
> > > >
> > > > SInce the application will require DB access you will need a dialog to
> > > > ask for credentials.
> > > >
> > > > I, personally, would be very surprised if such dialog would appear
> > > > somewhere at the bottom of the screen,
> > > > as dialogs ARE TLWs (top level windows).
> > > >
> > > > Wouldn't you?
> > >
> > > Yes, I would too - because I have my window manager configured to
> > > place that dialog where *I* want it, not where the application
> > > developer chose to put it.
> >
> > So, how do *you* distinguish between such dialog and all other dialogs
> > an application might raise (open/save dialogs. font selection dialog, user
> > warning thing).
> >
> > Because with my scenario there are 2 TLWs in the picture - main frame and
> > dialog for credentials.
> >
> > Besides it looks like you are setting this dialog to appear at constant position
> > anyway. Or am I missing smth?
>
> Hmm, maybe I'm missing something. The initial window isn't a "dialog",
> it's an application window. They follow slightly different rules
> (mainly, they don't have a parent window), but they still follow
> *rules*.

Not sure I follow - frame is a TLW. Dialog is a TLW.
Program flow is as follows:

1. Program starts with a frame
2. At some point the user asks to connect to the database.
3. Credentials dialog is shown.

Now, while frame is TLW and may follow the renderer rules, the dialog
that vask the user for credentials should not.

Now, system dialog should probably follow the rules of the WM, but if I want my
dialog to appear centered on the parent (not on the screen) - what
right the WM have
to override it?

I also think that ALL dialogs are TLWs independently of whether they
are created with
the actual parent (frame) or a null-parent (desktop).
In regards that they are not buttons/list controls/toolbars/etc.

>
> > > > So why I somewhat agree with such a notion - it is not always a useful feature.
> > > > Also, such an algorithm better allow me to save and restore the
> > > > geometry of the TLW.
> > >
> > > Why save and restore the geometry when the window manager can do a
> > > better job of positioning it? Give the WM the hints it needs, then let
> > > it figure out the placement.
> >
> > Because I want this application to appear at the same place every time?
> > The first time it shows I may just drag it away or minimize it at some point or
> > make it very small to clear the space.
> >
> > And the next time I want it to start at the same position.
>
> And I find that most apps that behave this way end up being more
> annoying than not.

Well its just a matter of opinion than. ;-)

>
> > > Consider that the last time your window was opened, I might have had
> > > one 1366x768 monitor, but now I have four - 1920x1080, 1920x1080,
> > > 1280x1024, and 1600x900. Where should your dialog go? Not your
> > > problem, because my WM knows and understands.
> >
> > There is a notion of the "primary display" which is here for a reason. ;-)
> > So you can attach/detach as many monitors as you want - in the end if
> > the monitor is not available and that window will appear on the primary monitor.
>
> In the second scenario, the primary monitor is at position (1920, 0).
> So you've just described exactly what a window manager does - follow
> rules to decide where the window appears - and NOT what happens if you
> remember geometry, which would be to put the window somewhere in the
> top left. You see the problem with remembering geometry?

Are you talking about geometry or a position?
For me geometry is a complex thing - position, size of the window and
the client size
of the window (which is important especially in *nix).

>
> > > (That's actually a 100% realistic scenario, given that I'm usually on
> > > my desktop system, but occasionally I'll be on my laptop, SSH'd in
> > > with X11 forwarding.)
> >
> > Absolutely.
> > I found myself in this situation recently - when I'm in the office I
> > have 2 external
> > monitors, and when I am at home - I only have a laptop.
> > And windows are showing on the primary all the time.
> >
>
> Right! That's the WM's job. Let it do its job, and everyone's lives
> will be easier.

Well, please re-read my initial statement.
You can't decide where to put that credential dialog. It has to appear
in the middle
of the screen (if there is 1 - on it, if multiple - on the screen
where the main frame is).

DO you see the problem with that?

Thank you.

>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list


More information about the Python-list mailing list