[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: Glass backends - xGravity and yGravity
From:       Thiago_Milczarek_SayĆ£o <thiago.sayao () gmail ! com>
Date:       2020-12-24 0:59:31
Message-ID: CAAP_wumLkabn7y3aGkBcS78r5nQ1n+dEY9MgasUqo5bjZzxSUg () mail ! gmail ! com
[Download RAW message or body]

Thanks for the reply.

It does not change the initial window position or the centerOnScreen()
positioning.

>   * Gravity values specify how to correct window location if only its size
>   * changes (for example when stage decorations are added). User initiated
>   * resizing should be ignored and must not influence window location
through
>   * this mechanism.

This says "when stage decorations are added". Are there any scenarios where
decorations are added after the window is shown? I think it's not possible,
except fullscreen/unfullscren (but it does not apply).

Decoration sizes are up to the window manager, so there is no way the "java
side" would know about them.

Cheers.

Em qua., 23 de dez. de 2020 Ć s 20:41, Kevin Rushforth <
kevin.rushforth@oracle.com> escreveu:

> I missed seeing this earlier. I can confirm that xGravity and yGravity
> are not used at all on Mac or Windows. I don't know why the Linux glass
> backend uses it, but it may have something to do with the asynchronous
> nature of X11. If you ignore it, does it change anything relating to the
> initial positioning? The only place I see x/yGravity set to a non-zero
> value is in the centerOnScreen method.
>
> -- Kevin
>
>
> On 12/14/2020 2:26 PM, Thiago Milczarek SayĆ£o wrote:
> > Hi,
> >
> > Question: Are the xGravity and yGravity still in use?
> >
> > Windows glass backend seems to ignore it, and I can't think of any
> scenario
> > where this would be used on Linux glass backend.
> >
> > package com.sun.glass.ui;
> >
> >
> > public abstract class Window {
> > ......
> >
> > /**
> >   * Sets the window bounds to the specified values.
> >   *
> >   * Gravity values specify how to correct window location if only its
> size
> >   * changes (for example when stage decorations are added). User
> initiated
> >   * resizing should be ignored and must not influence window location
> through
> >   * this mechanism.
> >   *
> >   * The corresponding correction formulas are:
> >   *
> >   * {@code x -= xGravity * deltaW}
> >   * {@code y -= yGravity * deltaH}
> >   *
> >   * @param x the new window horizontal position, ignored if xSet is set
> to
> >   *          false
> >   * @param y the new window vertical position, ignored if ySet is set to
> >   *          false
> >   * @param xSet indicates whether the x parameter is valid
> >   * @param ySet indicates whether the y parameter is valid
> >   * @param w the new window width, ignored if set to -1
> >   * @param h the new window height, ignored if set to -1
> >   * @param cw the new window content width, ignored if set to -1
> >   * @param ch the new window content height, ignored if set to -1
> >   * @param xGravity the xGravity coefficient
> >   * @param yGravity the yGravity coefficient
> >   */
> > public void setBounds(float x, float y, boolean xSet, boolean ySet,
> >                        float w, float h, float cw, float ch,
> >                        float xGravity, float yGravity)
>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic